XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEEDToolBox

【WinUI】XFE精英危险工具箱

公开
关注 0 Fork 0 Star 0
UTF-8
using XFEEDToolBox.ViewModels;
namespace XFEEDToolBox.Views;
public sealed partial class EngineeringPage : Page
{
    public ToolboxViewModel ViewModel => App.ViewModel;
    public EngineeringPage()
    {
        InitializeComponent();NavigationCacheMode=Microsoft.UI.Xaml.Navigation.NavigationCacheMode.Required;
        SizeChanged+=(_,_)=>LayoutCatalogue();Loaded+=(_,_)=>LayoutCatalogue();
    }
    private void LayoutCatalogue()
    {
        var compact=ActualWidth<1150;var narrow=ActualWidth<800;
        TypesColumn.Width=new GridLength(narrow?0:220);
        Grid.SetColumn(TypesPanel,narrow?1:0);Grid.SetColumnSpan(TypesPanel,narrow?2:1);Grid.SetRow(TypesPanel,0);
        Grid.SetColumn(EditorPanel,1);Grid.SetRow(EditorPanel,narrow?1:0);Grid.SetColumnSpan(EditorPanel,compact?2:1);
        Grid.SetColumn(BudgetPanel,compact?1:2);Grid.SetRow(BudgetPanel,compact?(narrow?2:1):0);Grid.SetColumnSpan(BudgetPanel,compact?2:1);
    }
}