Click here to Skip to main content
15,912,493 members
Home / Discussions / WPF
   

WPF

 
Question[Message Deleted] Pin
cristi2go30-Jun-08 7:13
cristi2go30-Jun-08 7:13 
AnswerRe: VB.Net 3D in wpf Pin
Paul Conrad1-Jul-08 17:03
professionalPaul Conrad1-Jul-08 17:03 
QuestionTrigger problems [modified] Pin
GDavy30-Jun-08 1:34
GDavy30-Jun-08 1:34 
AnswerRe: Trigger problems Pin
Gideon Engelberth30-Jun-08 5:52
Gideon Engelberth30-Jun-08 5:52 
GeneralRe: Trigger problems Pin
GDavy30-Jun-08 20:42
GDavy30-Jun-08 20:42 
QuestionErrors appear sometimes [modified] Pin
jamie55029-Jun-08 3:29
jamie55029-Jun-08 3:29 
AnswerRe: Errors appear sometimes Pin
Insincere Dave29-Jun-08 4:59
Insincere Dave29-Jun-08 4:59 
QuestionWhy does ToggleButton fail to obey binding when clicked? Pin
RNEELY27-Jun-08 7:29
RNEELY27-Jun-08 7:29 
Please help. I tracked down a bug down to the fact that a toggle button in my app ignores it’s binding. I’ve simplified to the enclosed example WPF app. What I want is the BoundToChecked toggle button to only reflect the real value of ValueSource.Checked. What occurs is when the BoundToChecked toggle button is clicked it changes visual state even if ValueSource.AllowChange is false!


Any suggestions or advice would be most appreciated.



Thanks,

Ron


<br />
// ValueSource.cs<br />
<br />
using System;<br />
<br />
using System.ComponentModel;<br />
<br />
namespace ToggleButtonBound<br />
<br />
{<br />
<br />
    class ValueSource : INotifyPropertyChanged<br />
<br />
    {<br />
<br />
        private bool _allowChange;<br />
<br />
        public bool AllowChange<br />
<br />
        {<br />
<br />
            get { return _allowChange; }<br />
<br />
            set<br />
<br />
            { <br />
<br />
                _allowChange = value;<br />
<br />
                OnPropertyChanged("AllowChange");<br />
<br />
            }<br />
<br />
        }<br />
<br />
        private bool _checked;<br />
<br />
        public bool Checked <br />
<br />
        { <br />
<br />
            get {return _checked;}<br />
<br />
            set<br />
<br />
            {<br />
<br />
                if (AllowChange)<br />
<br />
                {<br />
<br />
                    _checked = value;<br />
<br />
                    OnPropertyChanged("Checked");<br />
<br />
                }<br />
<br />
            }<br />
<br />
        }<br />
<br />
        #region INotifyPropertyChanged Implementation<br />
<br />
        public event PropertyChangedEventHandler PropertyChanged;<br />
<br />
        protected virtual void OnPropertyChanged(string property)<br />
<br />
        {<br />
<br />
            if (PropertyChanged != null)<br />
<br />
            {<br />
<br />
                PropertyChanged(this, new PropertyChangedEventArgs(property));<br />
<br />
            }<br />
<br />
        }<br />
<br />
        #endregion<br />
<br />
    }<br />
<br />
}<br />
<br />
 <br />
<br />
// Window1.xaml<br />
<br />
<Window x:Class="ToggleButtonBound.Window1"<br />
<br />
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br />
<br />
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br />
<br />
    xmlns:me="clr-namespace:ToggleButtonBound"<br />
<br />
    Title="ToggleButtonBound" Height="300" Width="300"><br />
<br />
    <Window.Resources><br />
<br />
        <me:ValueSource x:Key="ValueSource" /><br />
<br />
    </Window.Resources><br />
<br />
    <StackPanel><br />
<br />
        <ToggleButton Content="Unbound"/><br />
<br />
        <ToggleButton Content="BoundToChecked" IsChecked="{Binding Source={StaticResource ValueSource}, Path=Checked, Mode=Default}"/><br />
<br />
        <CheckBox Content="AllowChange" IsChecked="{Binding Source={StaticResource ValueSource}, Path=AllowChange, Mode=Default}"/><br />
<br />
    </StackPanel><br />
<br />
</Window><br />


Sincerely,
-Ron

AnswerRe: Why does ToggleButton fail to obey binding when clicked? Pin
Insincere Dave27-Jun-08 16:45
Insincere Dave27-Jun-08 16:45 
QuestionExport WPF grid to HTML page !! Pin
Karunish25-Jun-08 1:23
Karunish25-Jun-08 1:23 
AnswerRe: Export WPF grid to HTML page !! Pin
Pete O'Hanlon25-Jun-08 1:43
mvePete O'Hanlon25-Jun-08 1:43 
QuestionWhat is killing all WPF command CanExecutes? Pin
artwallacex24-Jun-08 13:41
artwallacex24-Jun-08 13:41 
AnswerRe: What is killing all WPF command CanExecutes? Pin
RNEELY27-Jun-08 7:33
RNEELY27-Jun-08 7:33 
GeneralRe: What is killing all WPF command CanExecutes? Pin
artwallacex27-Jun-08 11:03
artwallacex27-Jun-08 11:03 
GeneralRe: What is killing all WPF command CanExecutes? Pin
RNEELY27-Jun-08 13:38
RNEELY27-Jun-08 13:38 
GeneralRe: What is killing all WPF command CanExecutes? Pin
artwallacex27-Jun-08 14:07
artwallacex27-Jun-08 14:07 
QuestionWrapping a WPF GUI component to use it with a HID different than mouse? Pin
Member 367304824-Jun-08 7:07
Member 367304824-Jun-08 7:07 
QuestionMaking Refresh on Viewport3D Pin
sondos0123-Jun-08 23:46
sondos0123-Jun-08 23:46 
QuestionLoading DWF/DXF/DWG file Pin
Member 384581521-Jun-08 0:15
Member 384581521-Jun-08 0:15 
AnswerRe: Loading DWF/DXF/DWG file Pin
Pete O'Hanlon21-Jun-08 0:51
mvePete O'Hanlon21-Jun-08 0:51 
AnswerRe: Loading DWF/DXF/DWG file Pin
wout de zeeuw1-May-11 10:37
wout de zeeuw1-May-11 10:37 
QuestionSingleInstance Application Pin
Jammer20-Jun-08 9:21
Jammer20-Jun-08 9:21 
AnswerRe: SingleInstance Application Pin
Pete O'Hanlon20-Jun-08 9:44
mvePete O'Hanlon20-Jun-08 9:44 
QuestionRe: SingleInstance Application [modified] Pin
Jammer20-Jun-08 12:25
Jammer20-Jun-08 12:25 
AnswerRe: SingleInstance Application Pin
Pete O'Hanlon21-Jun-08 0:49
mvePete O'Hanlon21-Jun-08 0:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.