Commit 4559d669 authored by 潘栩锋's avatar 潘栩锋 🚴

添加 MenuProfile,MenuSetting 模板

parent 4e7ef69c
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Normal.UI;component/Themes/Styles.xaml"/> <ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</UserControl.Resources> </UserControl.Resources>
......
<UserControl x:Class="FLY.Thick.Base.UI.Client.UiModule.MenuProfile"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FLY.Thick.Normal.UI.Client.UiModule"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d" >
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<StackPanel>
<Button Style="{StaticResource ButtonStyle_icon}" Foreground="White"
Click="btnProfileClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="ClipboardText" />
<TextBlock Text="产品" Foreground="White"/>
</StackPanel>
</Button>
</StackPanel>
</UserControl>
using MultiLayout;
using MultiLayout.UiModule;
using System.Windows;
using System.Windows.Controls;
using Unity;
namespace FLY.Thick.Base.UI.Client.UiModule
{
/// <summary>
/// MenuProfile.xaml 的交互逻辑
/// </summary>
public partial class MenuProfile : UserControl
{
IUnityContainer container;
public MenuProfile()
{
InitializeComponent();
}
[InjectionMethod]
public void Init(IUnityContainer container)
{
this.container = container;
}
private void btnProfileClick(object sender, RoutedEventArgs e)
{
//PgBatteryProfileMultiFix p = new PgBatteryProfileMultiFix();
//container.BuildUp(p);
//FlyLayoutManager.NavigationService.Navigate(p);
}
}
public class UiModule2_MenuProfile : IUiModule2
{
public string Title => "电池产品";
public ComponentType Type => ComponentType.Menu;
public bool IsUnique => true;
public FrameworkElement GetComponent(int id, IUnityContainer container)
{
MenuProfile menu = new MenuProfile();
container.BuildUp(menu);
return menu;
}
public FrameworkElement GetThumbnail()
{
return new System.Windows.Controls.Grid();
}
public void MatchParam(int[] IDs)
{
}
}
}
<UserControl x:Class="FLY.Thick.Base.UI.Client.UiModule.MenuSetting"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FLY.Thick.Normal.UI.Client.UiModule"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d" >
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<StackPanel>
<Button Style="{StaticResource ButtonStyle_icon}" Foreground="White"
Click="btnProfileClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="Settings" />
<TextBlock Text="设置" Foreground="White"/>
</StackPanel>
</Button>
</StackPanel>
</UserControl>
using FLY.Thick.Normal.IService;
using MultiLayout;
using MultiLayout.UiModule;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Unity;
namespace FLY.Thick.Base.UI.Client.UiModule
{
/// <summary>
/// MenuProfile.xaml 的交互逻辑
/// </summary>
public partial class MenuSetting : UserControl
{
IUnityContainer container;
public MenuSetting()
{
InitializeComponent();
}
[InjectionMethod]
public void Init(IUnityContainer container)
{
this.container = container;
}
private void btnProfileClick(object sender, RoutedEventArgs e)
{
//PgMenu p = new PgMenu();
//container.BuildUp(p);
//FlyLayoutManager.NavigationService.Navigate(p);
}
}
public class UiModule2_MenuSetting : IUiModule2
{
public string Title => "电池参数";
public ComponentType Type => ComponentType.Menu;
public bool IsUnique => true;
public FrameworkElement GetComponent(int id, IUnityContainer container)
{
MenuSetting menu = new MenuSetting();
container.BuildUp(menu);
return menu;
}
public FrameworkElement GetThumbnail()
{
return new System.Windows.Controls.Grid();
}
public void MatchParam(int[] IDs)
{
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment