Monday, 15 August 2011

wpf - wp8 Binding CheckBox to CustomMessageBox via DataTemplate -


I want to define a data template to use it in a custom message box. In the code I open this dialog, but this check box can not be set inside the check box.

Please help me - How to properly bind the CDBIOVicetricated variable to a custom message box via a videomapple named DatatyMplate

XAML:

Lt; UserControl x: class = "myProj.RDPControl" ... & gt; & Lt; UserControl.Resources & gt; & Lt; DataTemplate x: key = "voicemail" & gt; & Lt; StackPanel margin = "32,0,0,0" & gt; & Lt; Checkbox X: Name = "cbVoiceAtt" content = "..." ischiked = "{binding CBIWOISECTED}" /> ... / * Other checkboxes * / & lt; / StackPanel & gt; & Lt; / DataTemplate & gt; & Lt; /UserControl.Resources> & Lt; Grid X: Name = "Layouts" & gt; ... this is the main control - works perfectly & lt; / Grid & gt;

In the code

  Public partial class RDPControl: UserControl {public RDPControl () {InitializeComponent (); //this.DataContext = this; } Public Bowl CBIWeAuitActatch {get; Set; } .... Private Voice VoiceButtonTap (Object Sender, System.Windows.Input.GestureEventArgsE) {cbVoiceAttChecked = true; // This price is bound to temlate !!! CustomMessageBox messageBox = new template to use a custom message box () {caption = "...", message = "...", content template = (datatapplet) (this. [Resource ["voicemplate"]), // template from XML datacontact = This, // I use the cbVoiceAttChecked variable to communicate Left content = "yes", RightButtonContent = "no"}; ... messageBox.Show (); }  

You must change your cbVoiceAttChecked property Dependency Property , or implement the INotifyPropertyChanged interface in your RDPControl class.

You interface at MSDN and about the dependency property s and pages on MSDN.

Of course, it all depends on you that your ContentTemplate object inside your RDPControl class. As you did not show up, I can not confirm that making the above changes will fix your problem.


No comments:

Post a Comment