I have created 2 states for the main window of the program (big and small) and i have added a tabcontrol with 2 tab items. I want to use the big state to change the size of the window when i am in tab1 and small state to change the size of window when i am in tab2. I used the following code but an unable to change the window size.
private void Changes(object sender, SelectionChangedEventArgs e)
{
if (tab1.IsSelected)
{
VisualStateManager.GoToElementState(window, "Big", true);
b1.Text = Convert.ToString(i);
}
else
{
VisualStateManager.GoToElementState(window, "Small", true);
b1.Text = Convert.ToString(i);
}
}
the method Changes is the tabcontrol's SelectionChanged event.
I cannot find what i did wrong here.