Hello
I have a window (for example MainWindow), in that window situated SfDataGrid in Row 1, ond page, on Row 2:
<Grid Grid.Row="2">
<Frame Source="MainButtonsBar.xaml" NavigationUIVisibility="Hidden" />
</Grid>
Scheme of windows is following MainWindow.xaml->MainButtonsBar.xaml -> Page1
-> Page2
MainButtonsBar.xaml contains ToggleButton:
<ToggleButton x:Name="ShowColumnChooser" Grid.Row="0" Grid.Column="1"
Command="{Binding ColumnChooserCommand}"
CommandParameter="ShowColumnChooser"
Content="ShowColumnChooser"
IsChecked="{Binding ShowColumnChooser}" />
In MainWindow i have Behaviors:
<intty:Interaction.Behaviors>
<local:MainWindowBehaviour />
</intty:Interaction.Behaviors>
In Behavior i have following code:
_mainWindowViewModel = (AssociatedObject.DataContext) as MainWindowViewModel;
if (_mainWindowViewModel != null)
_mainWindowViewModel.ColumnChooserCommand = new DelegateCommand<object>(ColumnChooserCommandHandler);
InitializeColumnChooserPopup();
private void InitializeColumnChooserPopup()
{
_chooserWindow = new ColumnChooser(AssociatedObject.GwMain);
_chooserWindow.Resources.MergedDictionaries.Clear();
_chooserWindow.ClearValue(FrameworkElement.StyleProperty);
_chooserWindow.Resources.MergedDictionaries.Add(AssociatedObject.GwMain.Resources.MergedDictionaries[0]);
AssociatedObject.GwMain.GridColumnDragDropController = new GridColumnChooserController(AssociatedObject.GwMain,_chooserWindow);
_chooserWindow.Width = 300;
_chooserWindow.Height = 600;
_chooserWindow.AllowsTransparency = true;
_chooserWindow.Show();
_chooserWindow.Owner = AssociatedObject;
_chooserWindow.Closing += ChooserWindow_Closing;
}
When i click in that button i want to show ColumnChooser of SfDataGrid situated on MainWindow, but they not shown. Only when MainWindow fist time load triggers _chooserWindow.Show(); and ColumnChooser shows (only ones) and if i close it, columnChooser not shown by pressing button. If i place ToggleButton directly on MainWindow, all Ok and DelegateCommant route to nested event and i can open-close ColumnChooser multiply times.
Can you help me with that problem?