-1

How to make the tab control save the modifications made to the content of this tab?

For example I have a grid with some ComboBox and I play with them. If I switch the tab, ComboBox not save the changes that I applied

Sebastian
  • 27
  • 11

1 Answers1

0
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1">
   <Label Width="70" Margin="5" >Vertical</Label>
   <ComboBox Width="130" Margin="5" 
             Height="26" ItemsSource="{Binding Options}" SelectedValue="{Binding SelectedVertical}" 
             SelectionChanged="ComboBox_SelectionChanged"/>
</StackPanel>

    #region Options property
    private List<string> options;
    public List<string> Options
    {
        get { return options; }
        set
        {
            options = value;
            OnPropertyChanged(nameof(Options));
        }
    }
    #endregion

    #region SelectedVertical property
    private string selectedVertical;
    public string SelectedVertical
    {
        get { return selectedVertical; }
        set
        {
            selectedVertical = value;
            SetCategoryVerticalHorizontalFilteredOrdersAsync();
            OnPropertyChanged(nameof(SelectedVertical));
            OnPropertyChanged(nameof(DataTable));
        }
    }
    #endregion
Sebastian
  • 27
  • 11