Using VB.NET, I want to use a Toggle Button control in place of the standard TilePane Header button. This would allow my users to easily transition between tile panes without having to use the indistinguishable header button.
I reviewed the included 9.2 XAML Samples on this but I couldn't figure out how to translate/implement it to VB.NET/C# code. I cannot use the XAML-only approach since this code is maintained by developers that don't have strong web development/Silverlight skills.
If possible, can someone provide a clear example on how to do this using VB.NET/C# code.
Thanks in advance.
Don
Hi Don,The XAML is better approach but this sample will work:private void tv3_LayoutUpdated(object sender, EventArgs e){ foreach (TilePane tile in tv3.Items) { ToggleButton toggleButton = tile.Header as ToggleButton; if (toggleButton != null) { if (toggleButton.Tag != "ready") { FrameworkElement parent = VisualTreeHelper.GetParent(toggleButton) as FrameworkElement; if (parent != null) { Grid.SetColumnSpan(parent, 2); Canvas.SetZIndex(parent, 100); toggleButton.Tag = "ready"; } } } else { toggleButton = new ToggleButton(); toggleButton.Content = tile.Header; tile.Header = toggleButton; TilePaneCommandSource commandSource = new TilePaneCommandSource(); commandSource.EventName = "Click"; commandSource.CommandType = TilePaneCommand.Maximize; commandSource.Parameter = "Toggle"; Commanding.SetCommand(toggleButton, commandSource); } }}Regards,Marin
Marin,
Thanks for the answer. I used your code example and it worked well. Thanks again.
-Don
Sorry for the late response. I just got back from vacation. I will try it out and reply with the results. Thanks again,