| | |
| | | HorizontalContentAlignment="Stretch" |
| | | SizeChanged="UserControl_SizeChanged" |
| | | MouseLeftButtonDown="Grid_MouseLeftButtonDown" |
| | | Background="#FFF" > |
| | | Background="#FFF" |
| | | Focusable="True"> |
| | | <UserControl.Resources> |
| | | <ResourceDictionary> |
| | | <ResourceDictionary.MergedDictionaries> |
| | |
| | | using CommonModel; |
| | | using System; |
| | | using System; |
| | | using System.ComponentModel; |
| | | using System.Runtime.CompilerServices; |
| | | using System.Windows; |
| | |
| | | |
| | | public int Zindex |
| | | { |
| | | get { |
| | | return Canvas.GetZIndex(this); |
| | | } |
| | | set |
| | | { |
| | | Canvas.SetZIndex(this, value); |
| | |
| | | |
| | | private void Grid_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) |
| | | { |
| | | this.Focus(); |
| | | }
|
| | |
|
| | | private void UserControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
| | | {
|
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.ComponentModel;
|
| | | using System.Linq;
|
| | | using System.Runtime.CompilerServices;
|
| | | using System.Text;
|
| | | using System.Threading.Tasks;
|
| | | using System.Xml.Linq;
|
| | |
|
| | | namespace WPFProject.Models
|
| | | {
|
| | | public class NotifyBase : INotifyPropertyChanged
|
| | | {
|
| | | public event PropertyChangedEventHandler PropertyChanged;
|
| | |
|
| | | protected virtual void RaisePropertyChanged(string name)
|
| | | {
|
| | | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
| | | }
|
| | |
|
| | | protected void RaiseAndSetIfChanged<T>(ref T old, T @new, [CallerMemberName] string propertyName = null)
|
| | | {
|
| | | old = @new;
|
| | | if (propertyName != null)
|
| | | {
|
| | | RaisePropertyChanged(propertyName);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | using CommonModel; |
| | | using System; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Collections.ObjectModel; |
| | | using System.Linq; |
| | |
| | | using CommonModel; |
| | | using System; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Collections.ObjectModel; |
| | | using System.Linq; |
| | |
| | | using CommonModel; |
| | | using System; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | <Setter Property="Background" TargetName="Bd" Value="Orange"/> |
| | | <Setter Property="BorderBrush" TargetName="Bd" Value="#e17933"/> |
| | | </MultiTrigger> |
| | | <MultiTrigger> |
| | | <!--<MultiTrigger> |
| | | <MultiTrigger.Conditions> |
| | | <Condition Property="Selector.IsSelectionActive" Value="False"/> |
| | | <Condition Property="IsSelected" Value="True"/> |
| | | </MultiTrigger.Conditions> |
| | | <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Background}"/> |
| | | <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}"/> |
| | | </MultiTrigger> |
| | | </MultiTrigger>--> |
| | | <MultiTrigger> |
| | | <MultiTrigger.Conditions> |
| | | <Condition Property="Selector.IsSelectionActive" Value="True"/> |
| | | <Condition Property="IsSelected" Value="True"/> |
| | | </MultiTrigger.Conditions> |
| | | <Setter Property="Background" TargetName="Bd" Value="#e17933"/> |
| | | <Setter Property="BorderBrush" TargetName="Bd" Value="#e17933"/> |
| | | </MultiTrigger> |
| | | |
| | | <Trigger Property="IsEnabled" Value="False"> |
| | | <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> |
| | | </Trigger> |
| | |
| | | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| | | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| | | xmlns:local="clr-namespace:WPFProject.UI" |
| | | xmlns:hc="https://handyorg.github.io/handycontrol" |
| | | mc:Ignorable="d" |
| | | d:DesignHeight="450" d:DesignWidth="800"> |
| | | <UserControl.Resources> |
| | |
| | | <Style TargetType="Label"></Style> |
| | | <Style TargetType="ListView"></Style> |
| | | |
| | | <Style x:Key="tab" TargetType="TabItem" BasedOn="{StaticResource {x:Type TabItem}}"> |
| | | <Setter Property="Foreground" Value="Red"/> |
| | | </Style> |
| | | <Color x:Key="DarkPrimaryColor">#e17933</Color> |
| | | <Color x:Key="PrimaryColor">#e17933</Color> |
| | | <Color x:Key="PrimaryTextColor">#e17933</Color> |
| | | <Color x:Key="SecondaryTitleColor">#e17933</Color> |
| | | <Color x:Key="BorderColor">#e17933</Color> |
| | | </ResourceDictionary> |
| | | </UserControl.Resources> |
| | | |
| | | <Grid> |
| | | <TabControl ItemContainerStyle="{StaticResource tab}" TabStripPlacement="Left"> |
| | | <TabControl TabStripPlacement="Left"> |
| | | <TabItem Header="函数列表"> |
| | | </TabItem> |
| | | <TabItem Header="变量列表"> |
| | |
| | | <Grid> |
| | | <TabControl> |
| | | <TabItem Header="函数列表"> |
| | | <TreeView> |
| | | <TreeViewItem></TreeViewItem> |
| | | </TreeView> |
| | | </TabItem> |
| | | <TabItem Header="变量列表"> |
| | | </TabItem> |
| | |
| | | |
| | | <Style TargetType="Label"></Style> |
| | | <Style TargetType="ListView"></Style> |
| | | <Color x:Key="DarkPrimaryColor">#e17933</Color> |
| | | <Color x:Key="PrimaryColor">#e17933</Color> |
| | | |
| | | </ResourceDictionary> |
| | | </UserControl.Resources> |
| | |
| | | <!--<vt:ProgramList BorderThickness="1" BorderBrush="#000" Canvas.Left="335" Canvas.Top="121" utils:Resize.IsResizeable="True"></vt:ProgramList> |
| | | <vt:ProgramList BorderThickness="1" BorderBrush="#000" Canvas.Left="600" Canvas.Top="121" FocusableChanged="ProgramList_FocusableChanged"></vt:ProgramList>--> |
| | | |
| | | <local:BottomBar x:Name="BottomBar" Canvas.Bottom="0" Panel.ZIndex="99"/> |
| | | <local:BottomBar x:Name="BottomBar" Canvas.Bottom="0" Panel.ZIndex="9999999"/> |
| | | </Canvas> |
| | | </ScrollViewer> |
| | | |
| | |
| | | Loaded += UserControl_Loaded; |
| | | } |
| | | |
| | | private void ProgramList_FocusableChanged(object sender, DependencyPropertyChangedEventArgs e) |
| | | { |
| | | |
| | | } |
| | | |
| | | private List<CanvasPosition> InitGridSize() |
| | | { |
| | | List<CanvasPosition> result = new List<CanvasPosition>(); |
| | |
| | | |
| | | } |
| | | |
| | | public int CanvasChildrenCount { get; private set; } = 0; |
| | | private void HandleInnerWindow(InnerWindow inner) |
| | | { |
| | | inner.MinEvent += InnerWindowMin; |
| | | inner.MaxEvent += InnerWindowMax; |
| | | inner.ZIndexEvent += Inner_ZIndexEvent; |
| | | inner.GotFocus += Inner_GotFocus; |
| | | inner.AttachToCanvas(WorkArea); |
| | | inner.Zindex = CanvasChildrenCount++; |
| | | }
|
| | |
|
| | | private void Inner_GotFocus(object sender, RoutedEventArgs e)
|
| | | {
|
| | | CanvasHelper.SetTopZIndex(sender as InnerWindow, WorkArea, typeof(InnerWindow));
|
| | | } |
| | | |
| | | private void Inner_ZIndexEvent(object sender, EventArgs e) |
| | |
| | | { |
| | | MinInnerWindow min = sender as MinInnerWindow; |
| | | min.Inner.Visibility = Visibility.Visible; |
| | | CanvasHelper.SetTopZIndex(min.Inner, WorkArea, typeof(InnerWindow)); |
| | | BottomBar.RemoveMinWindow(min); |
| | | } |
| | | |
| | |
| | | { |
| | | public static void SetTopZIndex(InnerWindow element, DependencyObject parent, Type targetClass) |
| | | { |
| | | int max = 0; |
| | | int zindex = element.Zindex; |
| | | |
| | | for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++) |
| | | { |
| | | InnerWindow child = VisualTreeHelper.GetChild(parent, i) as InnerWindow; |
| | | if (child != null && targetClass == child.GetType()) |
| | | { |
| | | if (element == child) |
| | | if (element != child && child.Zindex >= zindex) |
| | | { |
| | | child.Zindex = 1; |
| | | } |
| | | else |
| | | { |
| | | child.Zindex = 0; |
| | | } |
| | | child.Zindex = child.Zindex-1; |
| | | } |
| | | |
| | | } |
| | | max++; |
| | | } |
| | | element.Zindex = max; |
| | | } |
| | | } |
| | | } |
| | |
| | | using CommonModel; |
| | | using System; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Collections.ObjectModel; |
| | | using System.Linq; |
| | |
| | | <DependentUpon>Form1.cs</DependentUpon> |
| | | </Compile> |
| | | <Compile Include="Models\CanvasPosition.cs" /> |
| | | <Compile Include="Models\NotifyBase.cs" />
|
| | | <Compile Include="Models\Program.cs" /> |
| | | <Compile Include="Models\Sequence.cs" /> |
| | | <Compile Include="Models\Step.cs" /> |
| | |
| | | <WCFMetadata Include="Connected Services\" /> |
| | | </ItemGroup> |
| | | <ItemGroup /> |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\CommonModel\CommonModel.csproj"> |
| | | <Project>{8af82d09-4932-4ddb-ad56-6bb9ffabb237}</Project> |
| | | <Name>CommonModel</Name> |
| | | </ProjectReference> |
| | | </ItemGroup> |
| | | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
| | | </Project> |
| | |
| | | |
| | | Microsoft Visual Studio Solution File, Format Version 12.00 |
| | | # Visual Studio Version 16 |
| | | VisualStudioVersion = 16.0.33328.57 |
| | | # Visual Studio Version 17
|
| | | VisualStudioVersion = 17.8.34408.163
|
| | | MinimumVisualStudioVersion = 10.0.40219.1 |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFProject", "WPFProject.csproj", "{D47D2314-5DD5-4899-ADF9-15ED057289D3}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonModel", "..\CommonModel\CommonModel.csproj", "{8AF82D09-4932-4DDB-AD56-6BB9FFABB237}" |
| | | EndProject |
| | | Global |
| | | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
| | |
| | | {D47D2314-5DD5-4899-ADF9-15ED057289D3}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {D47D2314-5DD5-4899-ADF9-15ED057289D3}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {D47D2314-5DD5-4899-ADF9-15ED057289D3}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {8AF82D09-4932-4DDB-AD56-6BB9FFABB237}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {8AF82D09-4932-4DDB-AD56-6BB9FFABB237}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {8AF82D09-4932-4DDB-AD56-6BB9FFABB237}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {8AF82D09-4932-4DDB-AD56-6BB9FFABB237}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | EndGlobalSection |
| | | GlobalSection(SolutionProperties) = preSolution |
| | | HideSolutionNode = FALSE |