Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2589
MaximizedStateChanging and TilePane.ContentTemplate
posted

Hello,

I set ContentTemplate for different states in MaximizedStateChanging event. I have a grid in Maximized template and I have to find it when state is changed. And that's what I got:

1. State changes from any state to Maximized (that's when I need to find a grid). Search returns null.

2. State changes from Maximized to any state. Search returns valid grid.

Looks like TilePane first changes state and runs all "MaximizedState..." events, and after that it initializes child controls. Right? I need that grid exactly when pane state changes to Maximized. Which event should I subscribe to?

Thanks.

 

Parents
  • 3071
    posted

    Hi,
    You can try this in MaximizedStateChanged eventhandler, but I'm not sure if I understand your question correctly. Could you post a samle code?
    This code changes the ContentTemplate of a tile in maximized state:
    TilePane tile = e.Element as TilePane;
    if (e.NewState == TileState.Maximized)
        tile.ContentTemplate =
    this.Resources["maxTemplate"] as DataTemplate;
    else
       
    tile.ContentTemplate = null;

    Marin

     

Reply Children