7.8 Law, Regulations, and Policy
7.8.1 Export. Exporter. Exporter. The basic liability of the exporter of a product is on the seller of the product.
Category:Political history of Hungary
Category:Political history of the Kingdom of Hungary
Category:Hungarian Revolution of 1956
Category:1956 in Hungary
Category:1956 documents
Category:Documents of the Hungarian Revolution of 1956Q:
How do I make a data binding to my ViewModel Property that only updates the value when the mouse is clicked on?
I am creating a custom button for my WPF application. I've set up my Custom Button to update the value of a property on the view model in my View when the mouse is clicked on. This all works as expected.
The problem is that when the data binding does not update the value of the property until the mouse button is released, and the cursor is still over the control. This means that the data binding fires the PropertyChanged event twice, the first time setting the value to the default and then the second time setting the value to what the data binding was looking at the first time around.
So my question is, how do I get my view model property to only update when the mouse button is released on the control?
My view model class looks like this.
public class MyViewModel : ViewModelBase
{
private string _DisplayText;
public string DisplayText
{
get { return _DisplayText; }
set
{
if (value!= _DisplayText)
{
_DisplayText = value;
RaisePropertyChanged("DisplayText");
}
}
}
public MyViewModel()
{
DisplayText = "";
}
public MyViewModel(string aDisplayText)
{ be359ba680
Related links:
Kommentare