internal Grid CreateScript(string _header = "ExampleScript", params Grid[] _properties)
        {
            Grid       grid  = new Grid();
            StackPanel stack = new StackPanel()
            {
                Orientation = Orientation.Vertical, Spacing = 10
            };
            Expander expander = new Expander()
            {
                Header = _header, ExpandDirection = ExpandDirection.Down, HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalContentAlignment = HorizontalAlignment.Left
            };
            ToggleSwitch @switch = new ToggleSwitch()
            {
                IsOn = true, OffContent = "", OnContent = "", HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Top, Margin = new Thickness(0, 4, -69, 0)
            };

            foreach (var item in _properties)
            {
                stack.Children.Add(item);
            }

            expander.Content = stack;
            grid.Children.Add(expander);
            grid.Children.Add(@switch);

            return(grid);
        }
Esempio n. 2
0
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 // METHODS //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 private async void ViewModel_HelpTopicRequested(object sender, HelpTopic topic)
 {
     WinUI.Expander requestedExpander = ConvertHelpTopic(topic);
     if (requestedExpander != null)
     {
         requestedExpander.IsExpanded = true;
         PageLoaded = new TaskCompletionSource <bool>();
         await PageLoaded.Task;
         requestedExpander.StartBringIntoView();
     }
 }
Esempio n. 3
0
 private async void ViewModel_SettingsSectionRequested(object sender, SettingsSection section)
 {
     WinUI.Expander requestedExpander = ConvertSettingsSection(section);
     if (requestedExpander != null)
     {
         requestedExpander.IsExpanded = true;
         PageLoaded = new TaskCompletionSource <bool>();
         await PageLoaded.Task;
         requestedExpander.StartBringIntoView();
     }
 }
        internal Grid WrapExpander(Grid _content, string _header = "Expander")
        {
            Grid     grid     = new Grid();
            Expander expander = new Expander()
            {
                Header = _header, HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalContentAlignment = HorizontalAlignment.Left
            };

            expander.Content = _content;
            grid.Children.Add(expander);

            return(grid);
        }
Esempio n. 5
0
 protected void RaiseCollapsedEvent(Expander container)
 {
     Collapsed?.Invoke(this, new ExpanderCollapsedEventArgs());             // Uno Doc: We won't use null for args like WinUI
 }
Esempio n. 6
0
 protected void RaiseExpandingEvent(Expander container)
 {
     Expanding?.Invoke(this, new ExpanderExpandingEventArgs());             // Uno Doc: We won't use null for args like WinUI
 }
Esempio n. 7
0
        // WPF ExpanderAutomationPeer:
        // https://github.com/dotnet/wpf/blob/master/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/ExpanderAutomationPeer.cs

        public ExpanderAutomationPeer(Expander owner)
        {
            _owner = owner;
        }