Commit f866cdb1 authored by 潘栩锋's avatar 潘栩锋 🚴

添加 UiModul/DynAreaThick

parent ec9702ab
<UserControl x:Class="FLY.Thick.Base.UI.UiModule.DynAreaThick"
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.Base.UI.UiModule"
mc:Ignorable="d" d:DesignWidth="250"
>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Converter/Dictionary_MyConv.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style TargetType="TextBlock" x:Key="TextBlockStyle_ItemHeader">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontFamily" Value="YouYuan"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Foreground" Value="#FF3B3B3B"/>
<Setter Property="Margin" Value="5,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Border Style="{StaticResource BorderStyle_module}" Name="Border_AD" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid x:Name="grid_initparam"/>
<Border Background="{StaticResource Background_Title}" CornerRadius="3" Height="130" >
<Grid>
<Viewbox Margin="10">
<TextBlock Text="{Binding Thick,Converter={StaticResource thickconv}}" Foreground="White" FontSize="30" FontWeight="Bold" FontFamily="Microsoft Sans Serif" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Viewbox>
<TextBlock Text="{Binding ControllerState,Converter={StaticResource ctrlstateconv}}" FontSize="12" FontFamily="Microsoft Sans Serif" HorizontalAlignment="Right" VerticalAlignment="Bottom" Foreground="White" Margin="5"/>
</Grid>
</Border>
<StackPanel Grid.Row="1" Margin="2">
<Grid Margin="2" Name="grid_ad">
<Rectangle Fill="#FF86C2E9" HorizontalAlignment="Left">
<Rectangle.Width>
<MultiBinding Converter="{StaticResource ratioconv}" Mode="OneWay">
<Binding Path="AD" />
<Binding Path="ADMax" />
<Binding Path="ActualWidth" ElementName="grid_ad"/>
</MultiBinding>
</Rectangle.Width>
</Rectangle>
<StackPanel Orientation="Horizontal">
<TextBlock Text="AD" Style="{StaticResource TextBlockStyle_ItemHeader}" />
<TextBlock Text="{Binding AD, Converter={StaticResource ResourceKey=intconv}}" FontSize="24" FontFamily="Microsoft Sans Serif" TextAlignment="Center" HorizontalAlignment="Center" />
</StackPanel>
</Grid>
<Grid Margin="2">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Rectangle Fill="#FF86C2E9" HorizontalAlignment="Left" Grid.ColumnSpan="3">
<Rectangle.Width>
<MultiBinding Converter="{StaticResource ratioconv}" Mode="OneWay">
<Binding Path="Position" />
<Binding Path="DataContext.PosLength" ElementName="grid_initparam"/>
<Binding Path="ActualWidth" ElementName="grid_ad"/>
</MultiBinding>
</Rectangle.Width>
</Rectangle>
<StackPanel Orientation="Horizontal">
<TextBlock Text="位置" Style="{StaticResource TextBlockStyle_ItemHeader}" />
<TextBlock FontSize="24" FontFamily="Microsoft Sans Serif" TextAlignment="Center" HorizontalAlignment="Center" >
<Run>
<MultiBinding Converter="{StaticResource p2mmconv}" Mode="OneWay" StringFormat="{}{0:F0}">
<Binding Path="Position" />
<Binding Path="DataContext.Encoder1_mmpp" ElementName="grid_initparam"/>
</MultiBinding>
</Run>
</TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" FontSize="12" Foreground="Black">
<Run Text="mm"/>
</TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm_interval}" Text="|" FontSize="24" Foreground="Black"/>
<TextBlock Text="{Binding Position}" Style="{StaticResource TextBlockStyle_FieldContent_mm}" FontSize="12" Foreground="Black">
</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<TextBlock Text="{Binding Velocity,StringFormat={}{0:F1},Mode=OneWay}" FontSize="24" FontFamily="Microsoft Sans Serif" TextAlignment="Center" HorizontalAlignment="Center" />
<TextBlock Text="m/min" Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" FontSize="12" Foreground="Black"/>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</Border>
</UserControl>
using FLY.Thick.Base.Common;
using MultiLayout.UiModule;
using System.Windows;
using System.Windows.Controls;
using Unity;
namespace FLY.Thick.Base.UI.UiModule
{
/// <summary>
/// DynAreaThick.xaml 的交互逻辑
/// </summary>
public partial class DynAreaThick : UserControl
{
private DynArea dynArea;
private FLY.Thick.Base.IService.IInitParamService initParamService;
private IUnityContainer container;
public DynAreaThick()
{
InitializeComponent();
}
//public void Init(int id)
//{
// //获取设备
// TDGage gage = Application.Current.Properties["Gage"] as TDGage;
// this.DataContext = gage.mDynArea;
// grid_initparam.DataContext = gage.mInitParam;
//}
[InjectionMethod]
public void Init(
IUnityContainer container,
FLY.Thick.Base.IService.IDynAreaService dynAreaService,
FLY.Thick.Base.IService.IInitParamService initParamService
)
{
this.container = container;
this.dynArea = dynAreaService.DynArea;
this.initParamService = initParamService;
this.DataContext = this.dynArea;
grid_initparam.DataContext = this.initParamService;
}
}
public class UiModule2_DynAreaThick : IUiModule2
{
public string Title => "面密度状态";
public ComponentType Type => ComponentType.DynArea;
public bool IsUnique => true;
public FrameworkElement GetComponent(int id, IUnityContainer container)
{
DynAreaThick graph = new DynAreaThick();
container.BuildUp(graph);
return graph;
}
public FrameworkElement GetThumbnail()
{
return new System.Windows.Controls.Grid();
}
public void MatchParam(int[] IDs)
{
}
}
}
using FLY.Thick.Base.IService;
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.UiModule
......
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