Skip to content

Commit

Permalink
feat: 允许窗口拉伸及精简窗口
Browse files Browse the repository at this point in the history
1. 允许用户对应用程序随意拉伸窗口,以调整发送接收区的大小
2. 菜单栏视图实现精简窗口
  • Loading branch information
leven99 committed Oct 3, 2019
1 parent 21c79ad commit 3d308fd
Show file tree
Hide file tree
Showing 6 changed files with 355 additions and 278 deletions.
38 changes: 19 additions & 19 deletions App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ResourceDictionary>
<!--main xaml - menu style-->
<Style TargetType="MenuItem" x:Key="MainMenuItem">
<Setter Property="Padding" Value="5,3"/>
<Setter Property="Padding" Value="5,3,5,3"/>
</Style>
<Style TargetType="Button" x:Key="MainButton">
<Setter Property="Width" Value="36"/>
Expand All @@ -26,63 +26,63 @@
</Style>
<!--main xaml - Send block style-->
<Style TargetType="Button" x:Key="SendButton">
<Setter Property="Margin" Value="3,3,0,0"/>
<Setter Property="Width" Value="86"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Padding" Value="32,10"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="Black"/>
</Style>
<!--main xaml - Serial config block style-->
<Style TargetType="TextBlock" x:Key="SPTextBlock">
<Setter Property="Margin" Value="3.25,0,0,0"/>
<Setter Property="Margin" Value="3,0,0,0"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="ComboBox" x:Key="SPComboBox">
<Setter Property="Margin" Value="0,3.25,3.25,3.25"/>
<Setter Property="Width" Value="125"/>
<Setter Property="Height" Value="25"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,5,3,3"/>
<Setter Property="Padding" Value="6,6,5,6"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="Height" Value="Auto"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style TargetType="Ellipse" x:Key="SPEilipse">
<Setter Property="Width" Value="28"/>
<Setter Property="Height" Value="28"/>
</Style>
<Style TargetType="Button" x:Key="SPButton">
<Setter Property="Margin" Value="0,3.25,3.25,0"/>
<Setter Property="Width" Value="125"/>
<Setter Property="Height" Value="25"/>
<Setter Property="Padding" Value="6,1"/>
<Setter Property="Margin" Value="0,5,3,3"/>
<Setter Property="Padding" Value="48,6,48,6"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="Height" Value="Auto"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<!--main xaml - signal block style-->
<Style TargetType="TextBlock" x:Key="HDTextBlock">
<Setter Property="Margin" Value="0,5,0,0"/>
<Setter Property="Margin" Value="0,6,0,2"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="Ellipse" x:Key="HDEilipse">
<Setter Property="Margin" Value="0,5,0,0"/>
<Setter Property="Margin" Value="0,6,0,2"/>
<Setter Property="Width" Value="13"/>
<Setter Property="Height" Value="13"/>
</Style>
<!--main xaml - assist block style-->
<Style TargetType="CheckBox" x:Key="AssistCheckBox">
<Setter Property="Height" Value="25"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="TextBox" x:Key="AutoSendNumTextBox">
<Setter Property="Height" Value="25"/>
<Setter Property="Padding" Value="0,6"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="BorderBrush" Value="Black"/>
</Style>
<Style TargetType="Button" x:Key="AssistButton">
<Setter Property="Height" Value="25"/>
<Setter Property="Padding" Value="24,6"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="Black"/>
</Style>
Expand Down
43 changes: 43 additions & 0 deletions Models/HelpM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,55 @@ public string UpdateInfo
}
}

/// <summary>
/// 精简视图
/// </summary>
public bool _Reduced_Enable;
public bool Reduced_Enable
{
get
{
return _Reduced_Enable;
}
set
{
if (_Reduced_Enable != value)
{
_Reduced_Enable = value;
RaisePropertyChanged(nameof(Reduced_Enable));
}
}
}

/// <summary>
/// 视图可见性
/// </summary>
public string _View_Visibility;
public string View_Visibility
{
get
{
return _View_Visibility;
}
set
{
if (_View_Visibility != value)
{
_View_Visibility = value;
RaisePropertyChanged(nameof(View_Visibility));
}
}
}

public void HelpDataContext()
{
VerInfoNumber = "3.2.0";
VerInfo = "OSDA v" + VerInfoNumber;

UpdateInfo = "OSDA发现新版本le........";

Reduced_Enable = false;
View_Visibility = "Visible";
}

#region IDisposable Support
Expand Down
14 changes: 14 additions & 0 deletions ViewModels/MainWindowVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,20 @@ public void CrLfEnable()
}
#endregion

public void Reduced_Enable()
{
HelpModel.Reduced_Enable = !HelpModel.Reduced_Enable;

if(HelpModel.Reduced_Enable)
{
HelpModel.View_Visibility = "Collapsed";
}
else
{
HelpModel.View_Visibility = "Visible";
}
}

#region 帮助 - 检查更新
public async void UpdateAsync()
{
Expand Down
Loading

0 comments on commit 3d308fd

Please sign in to comment.