-
Notifications
You must be signed in to change notification settings - Fork 138
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
Design Time Error (XamlObjectWriterException: Collection property 'System.Windows.Controls.TextBox'.'Triggers' is null) #70
Comments
Thank you for submitting your issue. However, if you do not provide the required working reproduction sample, this issue will be closed. |
I do not what is a reproduction sample is. What do need? |
A running application that can replicate the issue you are having that we can use to step through and debug. |
I can't give you a reproduction sample for security reasons. |
You can't create a small stand-alone application that reproduces this issue? |
I can try. I'm going to need a day or two to make a smaller standalone. |
either provide a link to the github repo, or just upload the zip |
Here is reproduction example: |
(Same here, kind of a pain in Design: Blend of VS) |
@alphamax The full framework designer in Visual Studio uses an older architecture that does not fully support x64. If you have any of the 16.7 Previews installed (it safely installs side-by-side with the release channel version of VS) then you could try a preview of the new designer architecture for .NET Framework, which should fully support x64. From the 16.7 Preview Release Notes:
|
@alphamax I tested the project in WpfApp2.zip on a couple different machines; running VS 16.7 Preview 1, VS 16.7 Preview 4. The designer was broken until I enabled the new designer as @mgoertz-msft suggested. Visual Studio needs a restart after you enable the new designer. I assume you did that, but I thought I'd mention it anyway. |
You are right, the "minimal" demo application is working in this configuration, not the "product" one that is much more complex, and that produces the exception below... Thanks for your help, by the way. |
@alphamax The ArgumentNullException in DesignTimePropertyId..ctor just got fixed the other day and will be part of 16.7 Preview 5. In the meantime you could try and turn off the new "Expanded Design-time Data Support" Preview Feature, which hopefully avoids that problematic code path. Please let us know how that works for you. |
Thanks for all theses tips.
First i'll try to do is to "find" the assembly that does not seem to be loaded (even if at runtime i have no problem :/) |
It has been a few years, and this thread has gone stale. I recently tried to reproduce it using VS2022 and was not able to. Therefore, I am closing this issue. If this is still an issue, please let us know and we can reopen the thread. |
Describe the bug
I am getting a design time error using Interaction.Triggers in a data grid (see code at bottom). When the program is run it doesn't have any issues. I just can't see the User Control window in Visual Studio (see screenshot below).
To Reproduce
Steps to reproduce the behavior:
Error occurs at Design Time but when I remove or comment out the triggers the error goes away.
'''XAML
<i:Interaction.Triggers x:Uid="SSTriggers">
<i:EventTrigger EventName="LostFocus" >
<i:InvokeCommandAction Command="{Binding ElementName=SSLItemControl,
Path=DataContext.saveParamterizedCommand}" CommandParameter="{Binding}"/>
</i:EventTrigger>
<i:KeyTrigger Key="Enter">
<i:InvokeCommandAction Command="{Binding ElementName=SSLItemControl,
Path=DataContext.saveParamterizedCommand}" CommandParameter="{Binding}"/>
</i:KeyTrigger>
</i:Interaction.Triggers>
'''
Expected behavior
At design time I get the following error:
XamlObjectWriterException: Collection property 'System.Windows.Controls.TextBox'.'Triggers' is null.
Stack Trace
at System.Xaml.XamlObjectWriter.WriteGetObject()
at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
InnerException:None
Screenshots
If applicable, add screenshots to help explain your problem.
Below is a screenshot of my preview window in Visual Studio.
Desktop (please complete the following information):
Windows 10
Visual Studio Community 2017
Microsoft.Xaml.Behaviors.Wpf 1.1.19
I followed the steps on this website to setup triggers:
https://devblogs.microsoft.com/dotnet/open-sourcing-xaml-behaviors-for-wpf/
**Here is a reproduction example:
https://github.com/smittynusmc/Trigger_Error_Sample.git**
Update:
The error goes away when I change the debug platform from x64 to Any CPU.
Update:
When renaming variables and removing code to get ready for git. When I changed this code:
'''
'''
TO
'''
'''
The error went away (variable names may be different). Basically when I changed the binding names to anything other than the name in View Model the error was gone.
Also, any ItemSource or DataContext in which I change the name of the Binding the error goes away
The error comes back after running the program once.
The text was updated successfully, but these errors were encountered: