Hi,
I have a content page which I want to show based on a value being not null and I am using a converter for that.
Here is the code:
<igDock:SplitPane igDock:SplitPane.RelativeSize="100,100" SplitterOrientation="Vertical" > <igDock:ContentPane TabHeader="ViewerContentPane" x:Name="MyPane" > <igDock:ContentPane.Header> <TextBlock> <Run Text="Second Grid"/> </TextBlock> </igDock:ContentPane.Header> <igDP:XamDataGrid BindToSampleData="True" FieldLayoutInitialized="XamDataGrid_FieldLayoutInitialized"/> </igDock:ContentPane> <igDock:ContentPane TabHeader="Viewer" AllowClose="True" x:Name="ViewerPane" MinWidth="200" AutomationProperties.AutomationId="MyViewerPane" Header="Viewer" > <igDock:ContentPane.Style> <Style> <Setter Property="igDock:ContentPane.Visibility" Value="Collapsed"/> <Style.Triggers> <DataTrigger Binding="{Binding Path=Tag, ElementName=MyViewer, Converter={StaticResource isNullConverter}}" Value="False"> <Setter Property="igDock:ContentPane.Visibility" Value="Visible"/> </DataTrigger> </Style.Triggers> </Style> </igDock:ContentPane.Style> <ContentControl x:Name="MyViewer"></ContentControl> </igDock:ContentPane> </igDock:SplitPane>
here is the converter:
public class IsNullConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return (value == null); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new InvalidOperationException("IsNullConverter can only be used OneWay."); } }
Will appreciate your help.
Thanks,
Imad.
Andrew It worked. Thank you for your response.
As I mentioned you could handle the Closing event. In your case since you need to be updating the Tag anyway you could just set the Tag in the Closing and cancel the closing. e.g.
private void ViewerPane_Closing(object sender, Infragistics.Windows.DockManager.Events.PaneClosingEventArgs e){ MyViewer.Tag = null; e.Cancel = true; e.Handled = true;}
Please find attached the sample.
imadulhaque said: How to attach file? I can post you sample if you want to play with it.
How to attach file? I can post you sample if you want to play with it.
When you are replying you can go to the Options tab and attach a file.