Sunday 15 September 2013

windows runtime - WinRT XAML Toolkit BindableSelections not updating UI -


The XAML to deal with the selected item in my gridview and C # code.

I'm also using MVVM Light and everything is working, including being able to see what's selectedItems inside of me.

However, when I reflect changes made in SelectedItems clear attempt to, does not seem to me UI update / SelectedItems.

I WinRT XAML Toolkit (), which is using a GridView on

XAML

  & lt BindableSelection extension I am; Control: CustomGridView x: Name = "VideoItemGridView" Grid.Row = "2" margin = "0, -3,0,0" padding = "116,0,40,46" HorizontalContentAlignment = "muscle" VerticalContentAlignment = "Stretch" IsItemClickEnabled = "right" SelectionMode = "extended" extension: GridViewExtensions.BindableSelection = "{SelectedVideoItems binding mode = TwoWay}" ItemsSource = "{binding source = {StaticResource ViewSource}}" ItemTemplate = "{StaticResource VideoItemTemplate}" & gt; & Lt; GridView.ItemsPanel & gt; & Lt; ItemsPanelTemplate & gt; & Lt; Variable Sized Veragrid Madwidth = "250" Item Hight = "160" /> & Lt; / ItemsPanelTemplate & gt; & Lt; /GridView.ItemsPanel> & Lt; / Control: CustomGridView & gt;   

MyViewViewModel.cs

  #region selected items /// & lt; Summary & gt; /// sets or sets the selected video item. /// & lt; / Summary & gt; Public supervision & lt; Object & gt; Retrieve {Vote {Select it}. Selected videos; } Set {this._selectedVideoItems = value; This .set ("Selected VideoWimes", in this context. Selection- VIDEOItems, Value); }} Private observable collection & lt; Object & gt; _selectedVideoItems = New Observation Collection & lt; Object & gt; (); #endregion #region Click the application bar command /// & lt; Summary & gt; Click on /// ClearSelection to get the command. /// & lt; / Summary & gt; Public ICommand ClearSelectionClickCommand {get new relayCommand ((=) => This Clare Selection Operation ()); }} /// & lt; Summary & gt; /// Select All Command Operation. /// & lt; / Summary & gt; Private Wide Clear Collection selection () {This. SelectiveVideoNew = New Observation Collection & lt; Object & gt; (); } #endregion    

Clear your selected items in ClearSelectionOperation By calling

  this.selected video id.Clear (); Instead of   

  this.selected video item = new Observe Collection & lt; Object & gt; ();   

If that does not help to investigate the problem solving.

No comments:

Post a Comment