Click here to Skip to main content
15,884,472 members

Comments by bscaer (Top 11 by date)

bscaer 27-Mar-12 10:08am View    
Thanks very much. That is exactly what I had already implemented. Sorry that I didn't mention it. I was hoping for a clean, MVVM method that didn't involve having to touch two properties to get one value.
bscaer 26-Mar-12 18:43pm View    
"<pre> The XAML:

"open bracket" controls:MyControl
MyProperty="{Binding MyProperty, Mode=TwoWay}" "close bracket"

MyControl class:

public static readonly DependencyProperty MyPropertyProperty =
DependencyProperty.Register("MyProperty",
typeof(byte[]),
typeof(MyControl),
new PropertyMetadata(null)
);

ViewModel property:

byte [] MyProperty {get;set;}

Code on ViewModel that is run when the MenuItem is clicked:

public void MyMenuItemFunction()
{
// Get the up-to-date value of MyProperty from MyControl here
}</pre>
bscaer 26-Mar-12 18:42pm View    
Deleted
<pre> The XAML:

<controls:mycontrol
="" myproperty="{Binding MyProperty, Mode=TwoWay}">

MyControl class:

public static readonly DependencyProperty MyPropertyProperty =
DependencyProperty.Register("MyProperty",
typeof(byte[]),
typeof(MyControl),
new PropertyMetadata(null)
);

ViewModel property:

byte [] MyProperty {get;set;}

Code on ViewModel that is run when the MenuItem is clicked:

public void MyMenuItemFunction()
{
// Get the up-to-date value of MyProperty from MyControl here
}</pre>
bscaer 26-Mar-12 18:41pm View    
Deleted
The XAML:

<controls:mycontrol
="" myproperty="{Binding MyProperty, Mode=TwoWay}">

MyControl class:

public static readonly DependencyProperty MyPropertyProperty =
DependencyProperty.Register("MyProperty",
typeof(byte[]),
typeof(MyControl),
new PropertyMetadata(null)
);

ViewModel property:

byte [] MyProperty {get;set;}

Code on ViewModel that is run when the MenuItem is clicked:

public void MyMenuItemFunction()
{
// Get the up-to-date value of MyProperty from MyControl here
}
bscaer 26-Mar-12 18:13pm View    
Thanks. The problem is that the click is not on the control. The click is on a menu item.