Click here to Skip to main content
15,887,381 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Sorting ObservableCollection Pin
BlitzPackage15-May-09 15:32
BlitzPackage15-May-09 15:32 
GeneralRe: Sorting ObservableCollection Pin
Michael Sync15-May-09 22:19
Michael Sync15-May-09 22:19 
GeneralRe: Sorting ObservableCollection Pin
Kevin McFarlane16-May-09 6:37
Kevin McFarlane16-May-09 6:37 
AnswerRe: Sorting ObservableCollection Pin
Sebastian Solnica22-Nov-09 22:43
Sebastian Solnica22-Nov-09 22:43 
QuestionHelp: Binding huge data making application slower with 95% CPU usage Pin
Kunal Chowdhury «IN»13-May-09 19:37
professionalKunal Chowdhury «IN»13-May-09 19:37 
QuestionRe: Help: Binding huge data making application slower with 95% CPU usage Pin
Mark Salsbery14-May-09 7:18
Mark Salsbery14-May-09 7:18 
AnswerRe: Help: Binding huge data making application slower with 95% CPU usage [modified] Pin
Kunal Chowdhury «IN»14-May-09 18:38
professionalKunal Chowdhury «IN»14-May-09 18:38 
QuestionGot some problem with wpf multibinding Pin
Eric Vonjacson13-May-09 1:56
Eric Vonjacson13-May-09 1:56 
Hi,

I have some problem withe multi binding in wpf:
1) In the widnow cs file, I define a property like this:
private ObservableCollection<string> colltest = new ObservableCollection<string>();
public ObservableCollection<string> Coll
{
  get
  {
    return this.colltest;
  }
}

2) In the xaml file define a multi binding to the "togglebutton".
<ToggleButton Tag="dd" Content="TT" Width="50" Height="50">
  <ToggleButton.IsChecked>
    <MultiBinding Mode="OneWay" Converter="{x:Static app:SimpleConverter.Instance}">
      <Binding Mode="OneWay" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type app:Window1}}"
                     Path="Coll" />
      <Binding Mode="OneWay" RelativeSource="{RelativeSource Mode=Self}" Path="Tag" />
    </MultiBinding>
  </ToggleButton.IsChecked>
</ToggleButton>


3) and the covnert function of the converter is like this:
public object Convert(object[] value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
  bool bflag = false;

  if (value[0] == DependencyProperty.UnsetValue || value[0] == null||
   value[1] == DependencyProperty.UnsetValue ||
       value[1] == null)
    return bflag;

  ObservableCollection<string> v1 = value[0] as ObservableCollection<string>;
  string v2 = (string)value[1];

  if (v1 != null)
  {
    bflag = v1.Contains(v2);
  }

  return bflag;
}


It's working after the window is loadded. But however, after I add some new string to the collection "colltest", the togglebutton's "IsChecked" is not updated automatically.

I want it working in this way: If any changes are made to the collection "colltest". The togglebutton's "IsChecked" could update accordingly.

So how to resolve this problem?

thanks.
AnswerRe: Got some problem with wpf multibinding Pin
Mark Salsbery13-May-09 6:25
Mark Salsbery13-May-09 6:25 
AnswerRe: Got some problem with wpf multibinding Pin
Ian Shlasko13-May-09 8:18
Ian Shlasko13-May-09 8:18 
NewsGet started with Silverlight at XAMLFest Online in June Pin
brucedkyle12-May-09 9:49
brucedkyle12-May-09 9:49 
NewsGet started with WPF with XAMLFest Online in June Pin
brucedkyle12-May-09 9:48
brucedkyle12-May-09 9:48 
GeneralRe: Get started with WPF with XAMLFest Online in June Pin
Mark Salsbery12-May-09 9:49
Mark Salsbery12-May-09 9:49 
GeneralRe: Get started with WPF with XAMLFest Online in June Pin
#realJSOP12-May-09 10:47
mve#realJSOP12-May-09 10:47 
QuestionResource Dictionaries - Confused Pin
#realJSOP12-May-09 6:08
mve#realJSOP12-May-09 6:08 
AnswerRe: Resource Dictionaries - Confused Pin
Mark Salsbery12-May-09 6:51
Mark Salsbery12-May-09 6:51 
GeneralRe: Resource Dictionaries - Confused Pin
#realJSOP12-May-09 8:42
mve#realJSOP12-May-09 8:42 
GeneralRe: Resource Dictionaries - Confused Pin
Pete O'Hanlon12-May-09 8:51
mvePete O'Hanlon12-May-09 8:51 
GeneralRe: Resource Dictionaries - Confused Pin
#realJSOP12-May-09 8:58
mve#realJSOP12-May-09 8:58 
GeneralRe: Resource Dictionaries - Confused Pin
Pete O'Hanlon12-May-09 9:03
mvePete O'Hanlon12-May-09 9:03 
GeneralRe: Resource Dictionaries - Confused Pin
#realJSOP12-May-09 9:23
mve#realJSOP12-May-09 9:23 
GeneralRe: Resource Dictionaries - Confused Pin
Pete O'Hanlon12-May-09 9:26
mvePete O'Hanlon12-May-09 9:26 
GeneralRe: Resource Dictionaries - Confused Pin
#realJSOP12-May-09 11:01
mve#realJSOP12-May-09 11:01 
GeneralRe: Resource Dictionaries - Confused Pin
Pete O'Hanlon12-May-09 11:10
mvePete O'Hanlon12-May-09 11:10 
GeneralRe: Resource Dictionaries - Confused Pin
Mark Salsbery12-May-09 9:46
Mark Salsbery12-May-09 9:46 

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.