Friday, 15 May 2015

c# - Setting BooleanToVisibilityConverter to true depending on selected combo box value -


I need to add some arguments to my code based on the value of the BullionVisibility Connor on the right or false value selected from an XAML To make Combo Box cases complicated in my MVVM model, I actually have 2 combo boxes depending on the price shown in the Combo box 1 in the list displayed in the combo box 2 1

combo box 1 xa Mel

  & lt; Combo box margin = "103,6,0, 24" x: name = "firston" grid. Column = "1" displaymeterpath = "set crrittia" items source = "{binding criteria list}" selected etam = "{binding select cryariaria list, mode = two}" / & gt;  

combo box 1, the code behind

  public zero-searchWorldModel () {this.CriteriaList = new ObservableCollection & lt; SearchCriteriaList & gt; {New Search Contrioria List {Set Critia = "Date Range"}, New Search Security List {Set Critia = "Gateway"}, New Search Controllia List {Setsitria = "Direction"}}; This.OperatorList = new reviewable selection & lt; SearchOperatorList & gt; (); }  

combo box 2 xml

  & lt; Combo box margin = "103,41,1,40" x: name = "second" grid. Column = "1" grid. RowSpan = "2" DisplayMemberPath = "OperatorName" item source = "{binding operator list}" />  

combo box 2, code behind

  private redone list & lt; SearchOperatorLists & gt; DateOperatorList = New List & lt; SearchOperatorList & gt; {New search operator list {operator name = "today"}, new search operator list {operator name = "middle"}, new search operator list {operator name = "last month"}}; Private read-only list & lt; SearchOperatorList & gt; Gateway operator list = new list & lt; SearchOperatorList & gt; New SearchOperatorLists {operator name = "CCSUK"}, new search operator list {operator name = "mcp"}, new search operator list {operator name = "cns"}, new search operator list {operator name = "email"}} ; Private read-only list & lt; SearchOperatorList & gt; DirectionOperatorList = New list & lt; SearchOperatorList & gt; {New search operator list {operator name = "in"}, new search operator list {operator name = "out"}}; Private Searchrarianist Selected Syriatialist; Well, when using the on-property-spunky event, whenever the first object combo box (date range, gateway or direction) is selected in the combo box 2, then this list (date operator, gateway operator list, directional list) Display  

My requirement is to capture a value in the combo box 2, say "middle" and then set my boolean tugwillibility connector to the right which is the case Will display 2 date picker.

Any indication greatly appreciates.

Instead use an object model where children in your primary item (the first combo) property that contains items for the second combo box .

This will then be your second blankbox 's binding like:

    

In the long run, the issue of maintenance is very simple and if the list of dependent items changes.


No comments:

Post a Comment