WPF and X# 2.0.0.05
Posted: Fri Nov 02, 2018 10:41 am
Hi,
one of my WinForm Apps uses WPF Bing Maps V.7 (I wrote a WPF DLL containing the Bing Maps control).
Inside this WPF DLL assembly, one of the components I am using is an 'Infobox' Grid consisted by:
- InfoboxTitle (TextBlock)
- InfoboxDescription (TextBlock)
- CloseInfobox (Button)
some years ago, when I created the assembly, I set the Infobox Background="Black" and the InfoboxTitle and InfoboxDescription Foreground="#1cff1c" ('electric' Green).
Now, I am trying to change the Background and Foreground from my App by changing the 2 Properties sending values to the WPF assembly.
I noticed 2 errors:
1. The compiler conplains at:
PUBLIC CLASS MainVM IMPLEMENTS INotifyPropertyChanged
this Class is used to change the 2 Properties.
By the way, the ILSpy (XSharp) code shows:
public class MainVM implement INotifyPropertyChanged (not implements)
when translates my C# project to X#.
2. The compiler conplains Inside the .XAML at keyword: local:
<Window.DataContext>
<local:MainVM/>
</Window.DataContext>
i.e. when I try to reference this Class inside the .XAML code in order to use it the 2 Properties.
I am attaching 2 projects:
A> a C# named Wpf_PropertyChanged:
it works just fine and I can see the Background, Foreground color changes in XAML Editor.
The problem is I cannot use it because my WPF assembly is Vulcan.NET (X# now) is big (has many components) and I don't want to translate it to C#.
B> a X# named Wpf_XS:
here you can see the 2 errors
Both .XAML files (C# and X#) contain the SAME code.
In the C# one, I have as comments the old: Background="Black", Foreground="#1cff1c"
but in the X#, I have as comments the new (desired) code: Background="{Binding Path=BackgroundColor}", Foreground="{Binding Path=ForegroundColor}".
I know there are experts on WPF in this Group (Nick, Dick, Wolfgang, Philip etc.).
Could you please tell me if the 2 previously mentioned problems are mine errors, or really errors ?
thanks and regards
George
one of my WinForm Apps uses WPF Bing Maps V.7 (I wrote a WPF DLL containing the Bing Maps control).
Inside this WPF DLL assembly, one of the components I am using is an 'Infobox' Grid consisted by:
- InfoboxTitle (TextBlock)
- InfoboxDescription (TextBlock)
- CloseInfobox (Button)
some years ago, when I created the assembly, I set the Infobox Background="Black" and the InfoboxTitle and InfoboxDescription Foreground="#1cff1c" ('electric' Green).
Now, I am trying to change the Background and Foreground from my App by changing the 2 Properties sending values to the WPF assembly.
I noticed 2 errors:
1. The compiler conplains at:
PUBLIC CLASS MainVM IMPLEMENTS INotifyPropertyChanged
this Class is used to change the 2 Properties.
By the way, the ILSpy (XSharp) code shows:
public class MainVM implement INotifyPropertyChanged (not implements)
when translates my C# project to X#.
2. The compiler conplains Inside the .XAML at keyword: local:
<Window.DataContext>
<local:MainVM/>
</Window.DataContext>
i.e. when I try to reference this Class inside the .XAML code in order to use it the 2 Properties.
I am attaching 2 projects:
A> a C# named Wpf_PropertyChanged:
it works just fine and I can see the Background, Foreground color changes in XAML Editor.
The problem is I cannot use it because my WPF assembly is Vulcan.NET (X# now) is big (has many components) and I don't want to translate it to C#.
B> a X# named Wpf_XS:
here you can see the 2 errors
Both .XAML files (C# and X#) contain the SAME code.
In the C# one, I have as comments the old: Background="Black", Foreground="#1cff1c"
but in the X#, I have as comments the new (desired) code: Background="{Binding Path=BackgroundColor}", Foreground="{Binding Path=ForegroundColor}".
I know there are experts on WPF in this Group (Nick, Dick, Wolfgang, Philip etc.).
Could you please tell me if the 2 previously mentioned problems are mine errors, or really errors ?
thanks and regards
George