void WireUpFormsVsm()
 {
     if (Element.UseFormsVsm())
     {
         InterceptVisualStateManager.Hook(Control.GetFirstDescendant <Microsoft.UI.Xaml.Controls.Grid>(), Control, Element);
     }
 }
Example #2
0
        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 <Microsoft.UI.Xaml.Controls.Button>("FlyoutButton").FirstOrDefault();

            if (button != null)
            {
                InterceptVisualStateManager.Hook(button.GetFirstDescendant <Microsoft.UI.Xaml.Controls.Grid>(), button, Element);
            }
        }