void WireUpFormsVsm() { if (Element.UseFormsVsm()) { InterceptVisualStateManager.Hook(Control.GetFirstDescendant <Windows.UI.Xaml.Controls.Grid>(), Control, Element); } }
void WireUpFormsVsm() { if (!Element.UseFormsVsm()) { return; } InterceptVisualStateManager.Hook(Control.GetFirstDescendant <StackPanel>(), Control, Element); // We also have to intercept the VSM changes on the DatePicker's button var button = Control.GetDescendantsByName <Windows.UI.Xaml.Controls.Button>("FlyoutButton").FirstOrDefault(); InterceptVisualStateManager.Hook(button.GetFirstDescendant <Windows.UI.Xaml.Controls.Grid>(), button, Element); }