123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <UserControl
- x:Class="ShakerApp.Views.RandomMainPage"
- xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="using:ShakerApp"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:models="using:Shaker.Models"
- xmlns:oxy="http://oxyplot.org/avalonia"
- xmlns:suki="https://github.com/kikipoulet/SukiUI"
- xmlns:view="using:ShakerApp.Views"
- xmlns:vm="using:ShakerApp.ViewModels"
- d:DesignHeight="450"
- d:DesignWidth="800"
- x:DataType="vm:RandomMainPageViewModel"
- DataContext="{Binding Source={x:Static vm:RandomMainPageViewModel.Instance}}"
- mc:Ignorable="d">
- <Grid ColumnDefinitions="220,*">
- <ScrollViewer Grid.Column="0">
- <StackPanel>
- <view:ShakerMiniStatusControl />
- <view:OilMinView IsVisible="{Binding Source={x:Static vm:OilSourceStatusViewModel.Instance}, Path=IsEnabled}" />
- <Expander ExpandDirection="Down" IsExpanded="True">
- <Expander.Header>
- <TextBlock
- FontSize="24"
- FontWeight="Bold"
- Text="{DynamicResource TestInfo}" />
- </Expander.Header>
- <StackPanel Margin="4,0,0,0">
- <StackPanel>
- <TextBlock>
- <Run Text="{DynamicResource RandomTestStep}" />
- <Run Text=":" />
- </TextBlock>
- <TextBlock Text="{local:ResourceBinding RandomTestStepKey}" />
- </StackPanel>
- <StackPanel>
- <TextBlock>
- <Run Text="{DynamicResource CurrentIdentifyDisplacement}" />
- <Run Text=":" />
- </TextBlock>
- <TextBlock Text="{Binding CurrentIdentifyDisplacement, StringFormat='{}{0:F4}mm'}" />
- </StackPanel>
- <StackPanel>
- <TextBlock>
- <Run Text="{DynamicResource CurrentIdentifyRms}" />
- <Run Text=":" />
- </TextBlock>
- <TextBlock Text="{Binding TimeDomainRMS, StringFormat='{}{0:F4}g'}" />
- </StackPanel>
- <StackPanel>
- <TextBlock>
- <Run Text="{DynamicResource IdentifyIndex}" />
- <Run Text=":" />
- </TextBlock>
- <TextBlock Text="{Binding IdentifyIndex}" />
- </StackPanel>
- <StackPanel IsVisible="{Binding RandomTestStep, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static models:RandomTestStep.Test}}">
- <TextBlock>
- <Run Text="{DynamicResource CurrentTestLevel}" />
- <Run Text=":" />
- </TextBlock>
- <TextBlock Text="{Binding CurrentTestLevel, StringFormat='{}{0:F1}dB'}" />
- </StackPanel>
- <StackPanel IsVisible="{Binding RandomTestStep, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static models:RandomTestStep.Test}}">
- <TextBlock>
- <Run Text="{DynamicResource CurrentTestTime}" />
- <Run Text=":" />
- </TextBlock>
- <TextBlock Text="{Binding CurrentTestTime, Converter={StaticResource TimeToStringConverter}}" />
- </StackPanel>
- <StackPanel IsVisible="{Binding RandomTestStep, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static models:RandomTestStep.Test}}">
- <TextBlock>
- <Run Text="{DynamicResource CurrentLevelTestMaxTime}" />
- <Run Text=":" />
- </TextBlock>
- <TextBlock Text="{Binding CurrentLevelTestMaxTime, Converter={StaticResource TimeToStringConverter}}" />
- </StackPanel>
- </StackPanel>
- </Expander>
- </StackPanel>
- </ScrollViewer>
- <oxy:PlotView
- Grid.Column="1"
- Background="Transparent"
- Model="{Binding PlotModel}">
- <oxy:PlotView.DefaultTrackerTemplate>
- <ControlTemplate>
- <oxy:TrackerControl
- Background="#6F999999"
- BorderBrush="Transparent"
- CornerRadius="6"
- HorizontalLineVisibility="False"
- LineExtents="{Binding PlotModel.PlotArea}"
- LineStroke="Gray"
- Position="{Binding Position}"
- ShowPointer="True"
- VerticalLineVisibility="True">
- <oxy:TrackerControl.Content>
- <StackPanel Margin="10">
- <TextBlock Text="{DynamicResource Value}" />
- <TextBlock>
- <Run Text="{Binding XAxis.Title}" />
- <Run Text=":" />
- <Run Text="{Binding TrackerDatas[0].DataPoint.X, StringFormat='{}{0:F2}'}" />
- <Run Text="{Binding XAxis.Unit}" />
- </TextBlock>
- <ItemsControl ItemsSource="{Binding TrackerDatas}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <TextBlock IsVisible="{Binding Series.IsVisible}">
- <Run Text="{Binding Series.Title}" />
- <Run Text=":" />
- <Run Text="{Binding DataPoint.Y, StringFormat='{}{0:F4}'}" />
- <Run Text="{Binding $parent[ItemsControl].DataContext.YAxis.Unit}" />
- </TextBlock>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </StackPanel>
- </oxy:TrackerControl.Content>
- </oxy:TrackerControl>
- </ControlTemplate>
- </oxy:PlotView.DefaultTrackerTemplate>
- </oxy:PlotView>
- <Button
- Grid.Column="1"
- Margin="0,0,16,56"
- HorizontalAlignment="Right"
- VerticalAlignment="Bottom"
- Classes="Basic"
- Cursor="Hand">
- <Interaction.Behaviors>
- <EventTriggerBehavior EventName="Click">
- <InvokeCommandAction Command="{Binding Source={x:Static vm:PlotConfigViewModel.Instance}, Path=PlotConfigCommand}" CommandParameter="{Binding PlotModel}" />
- </EventTriggerBehavior>
- </Interaction.Behaviors>
- <PathIcon Background="Transparent" Data="{StaticResource SettingGeometry}">
- <PathIcon.Styles>
- <Style Selector="PathIcon:pointerover">
- <Setter Property="Foreground" Value="Black" />
- </Style>
- <Style Selector="PathIcon">
- <Setter Property="Foreground" Value="#AAAAAAAA" />
- </Style>
- </PathIcon.Styles>
- </PathIcon>
- </Button>
- </Grid>
- </UserControl>
|