-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Designer SDK Blog post #6
Conversation
@KlausLoeffelmann Very confusing sentence - this is not the only case when you will need much work to do :(
What will be the solution structure in this case? I mean it in terms of #9 - we need other more light template for this? About editors...
What about We defiantly need an examples for these cases too. |
That's exactly the problem the SDK solves. It's what the whole effort is all about! You have to - simplified - remote control the 4.7.2 UI from the .NET process. If you take a look at the template demo, it also isn't able to access the property directly which the Type Editor for. That's why we 're sending requests to change the value to server, which then does it. |
We need to make it work. We did it with every single collection editor in the WinForms runtime. Those are all part of the Out-Of-Proc Designer now. And yes, that's an additional effort, since you would need to define endpoints in the server for Add, Remove, Edit, and OK. That will be part of an additional Blog Post next year. But there is a sample for that as well already. It's named Sophisticated Demo in the repo. |
It is true the way I meant and think I have written it:
For the collection editors: Let's not get ahead of ourselves, though. We're about to finish the first part (everything BUT modified collection editors) which is covering 80% of the scenarios. And then let's take on the next step. |
Totally agree. And whole my previous post is about single value property editor - not collection editor:
----------------UPD----------------- Oh your answer fell under the comment - did not notice it :(
The further I dive into this, the more obvious it becomes that all this is not worth such effort :( ----------------UPD2----------------- I spent over two hours trying to get this editor to work in chart: internal class ImageValueEditor : FileNameEditor
{
public override bool GetPaintValueSupported(ITypeDescriptorContext context)
{
return false;
}
}
VS
And even with Do namespaces and assembly names matter? ----------------UPD3----------------- I was able to get it work in your demo project ----------------UPD4----------------- Still no luck with chart control :(((( I don't know what to do - everything works in the test project, and doesn't work here - @KlausLoeffelmann need your help 🙏 Resulting installed nuget structure:
DataVisualization.Client: namespace Charting.Designer.Client
{
internal class ImageValueEditor : FileNameEditor
{
public override bool GetPaintValueSupported(ITypeDescriptorContext context)
{
return true;
}
}
[ExportTypeRoutingDefinitionProvider]
internal class TypeRoutingProvider : TypeRoutingDefinitionProvider
{
public override IEnumerable<TypeRoutingDefinition> GetDefinitions()
{
return new[]
{
new TypeRoutingDefinition(
TypeRoutingKinds.Editor,
nameof(ImageValueEditor),
typeof(ImageValueEditor)),
};
}
}
} And string properties in chart decorated like: [Editor("ImageValueEditor", typeof(UITypeEditor))] |
/cc @KlausLoeffelmann |
I am completely swamped this week to get the blog posts out. In the meantime - can you send me the link to the branch you're working in? Is it still the same branch we had before? |
I scheduled some time for Friday morning. |
Thank you @KlausLoeffelmann |
Side note first (I think it's important): 17.5p1 designer work well with chart control referenced by nuget! So, in 17.5p1 we have:
Branch to pull: https://github.com/kirsan31/winforms-datavisualization/tree/DesignerTest Pull, build, open The easiest property to test our |
Hmm. Just as a very quick idea, because I ran into that before: Can you try to also set the I'll try to take a closer look on Friday morning. |
I have tried these three variants with no result: Editor("ImageValueEditor", typeof(UITypeEditor))
Editor("ImageValueEditor", "UITypeEditor")
Editor("ImageValueEditor", "FileNameEditor") |
Can you include the namespaces to fully qualify the types? If that doesn't work, start with a Type Editor that doesn't inherit from an existing one (take the templates). And then modify how you need it until it breaks, so we know where to start. |
I've already tried everything I can :( ImageValueEditor : UITypeEditor doesn't work too :( The funny thing is that in the test project - Everything is complicated by the fact that you constantly have to restart the studio because of this bug:
|
It definitely shouldn't. Using strings as type references is really important here. So, I think the problem is around the NuGet package pick-up. Please delete ALL the NuGet packages that get or got created in both repos, and see, if the compiler explains at one point. Make also sure, that in your test app, you only reference that NuGet and nothing else, so we can make sure, that the reference doesn't come from any other spot. |
OK, I took a look, and experimented a bit myself:
Please note, I'll be OOF this week (I am only here today to get this done, because I promised you! 😸). So let's take a break this week and continue Tuesday in a week (Nov. 29th). |
Thank you for your time @KlausLoeffelmann
I totally agree with your here and that's why I did exacly like this:
BUT I ran into a huge number of problems because the design part is strongly related to the control itself and it will be very difficult to separate them. Perhaps this can be done through a certain proxy project... <_File Include="$(SolutionDir)\src\System.Windows.Forms.DataVisualization\bin\$(Configuration)\$(TargetFrameworkServer)-windows\System.Windows.Forms.DataVisualization.dll" TargetDir="Design/WinForms/Server" />
In my opinion, everything is in order, one point is the current directory 🤷♂️
What you mean by correctly? In my tests, I rebuilt the projects, then the nuget package, then updated the package in the test app, then rebuilt that as well (test form is closed of course). I opened the form and saw no changes.. After that, I closed the solution and opened it again - it did not help, and only restart helped.
I came to the same thoughts :) The only thing is that Currently it's: <Target Name="CopyPackageD" AfterTargets="Pack" Condition="'$(Configuration)'=='Debug'">
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg"
DestinationFolder="$(SolutionDir)NuGet\BuildOut\"/>
<Exec Command="nuget.exe restore "$(SolutionDir)DesignerTest\DesignerTest.csproj" -ConfigFile "$(SolutionDir)NuGet.config"" />
</Target> And package reference is: <ItemGroup>
<PackageReference Include="WinForms.DataVisualization.Debug" Version="$(MajorVer).*" />
</ItemGroup> |
You can reference the control projectfrom the Designer-sever project, so that shouldn't break anything in a too complicated way. If you have control dependencies to the Client (Framework) right now, that's not gonne work anyway. |
My bad, by the evening everything was mixed up in my head 😔
I think all of this due to assembly name bug - see my next post. |
Stunned, but at some point it worked!!! The only change is rename of main assembly from After this change we have side affect (two chart controls on the toolbox): But with Also... I already found some bugs and blocking problems - we are defiantly need repo where to post them... |
@KlausLoeffelmann are you back? :) I've spend some time (lots :)))) on porting editors and I think now I can give a more concrete feedback. Designer bugs.
SDK questions / suggestions.
GridItem item = grid.SelectedGridItem;
// Original code:
//_helpTopic = item.PropertyDescriptor.ComponentType.ToString() + "." + item.PropertyDescriptor.Name;
// We have a proxy object (Microsoft.DotNet.DesignTools.Client.Proxies.ProxyPropertyDescriptor) here as PropertyDescriptor.
// So to get real type we need get PropertyData (Microsoft.DotNet.DesignTools.Protocol.PropertyData) from PropertyDescriptor and then ComponentType from it.
// Because Microsoft.DotNet.DesignTools.Client.Proxies.ProxyPropertyDescriptor and Microsoft.DotNet.DesignTools.Protocol.PropertyData are internal we need to use reflection...
if (item.PropertyDescriptor.GetPropValue("PropertyData")?.GetPropValue("ComponentType") is Microsoft.DotNet.DesignTools.Protocol.Types.TypeIdentity typeIdentity)
_helpTopic = typeIdentity.TypeName + "." + item.PropertyDescriptor.Name;
Questions.With single editors +- all clear. protected virtual Type[] CreateNewItemTypes (); If we override it, we will have In new P.s. Can you some how ping some one from VS team? I have very specific bug with VS on my laptop: https://developercommunity.visualstudio.com/t/Net-local-variables-not-captured-by-deb/10216016 - local variables not captured by debugger at any projects any more :( I tried everything I could find on the Internet and came up with it myself - nothing helps. I really don't know what to do 😭😭😭 Thanks. |
I am and then I am not. I'll be physically here until end of the week, and then I will be OOF until early January. I most certainly won't get to it until end of the week (maybe for the questions, I'll certainly try!). I will try to take some time in between the holidays (between Dec. 27th and January 3rd) but cannot promise anything. I have one ask, though: I will then take this repo private, but don't worry: You, of course, will still be able to access it, so we can go back to look up discussions we've had in the past. This way, we will be working on issues on the right place. |
Work on this repo's ReadMe, which will ultimately become the .NET Blog Post for the Designer SDK.
We will also add this sample project to the .NET Samples repo.