-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
新增 搜索框添加便签
- Loading branch information
Showing
9 changed files
with
156 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,5 +122,6 @@ public enum FileType | |
数学运算, | ||
UWP应用, | ||
自定义情景, | ||
便签, | ||
None | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Core.SDKs.Services; | ||
|
||
public interface ILabelWindowService | ||
{ | ||
public void Show(); | ||
public void Show(string content); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
|
||
namespace Core.ViewModel.Pages; | ||
|
||
public partial class LabelWindowViewModel : ObservableObject | ||
{ | ||
[ObservableProperty] private int _fontSize = 16; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Windows; | ||
using Core.SDKs.Services; | ||
using Kitopia.View; | ||
|
||
namespace Kitopia.Services; | ||
|
||
public class LabelWindowService : ILabelWindowService | ||
{ | ||
public void Show() | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public void Show(string content) | ||
{ | ||
Application.Current.Dispatcher.BeginInvoke(() => | ||
{ | ||
var labelWindow = ((LabelWindow)ServiceManager.Services!.GetService(typeof(LabelWindow))!); | ||
labelWindow.Show(); | ||
labelWindow.RichTextBox.Text = (content); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<ui:FluentWindow x:Class="Kitopia.View.LabelWindow" | ||
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:ui="http://schemas.lepo.co/wpfui/2022/xaml" | ||
xmlns:pages="clr-namespace:Core.ViewModel.Pages;assembly=Core" | ||
mc:Ignorable="d" | ||
ExtendsContentIntoTitleBar="True" | ||
WindowBackdropType="Acrylic" d:DataContext="{d:DesignInstance pages:LabelWindowViewModel}" | ||
Title="LabelWindow" Height="300" Width="300"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="30" /> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="50" /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="100" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<ui:TitleBar Grid.ColumnSpan="2" CanMaximize="False" ShowMaximize="False" ShowMinimize="False" /> | ||
|
||
<ui:TextBox Grid.Row="1" Grid.ColumnSpan="2" Grid.RowSpan="2" x:Name="RichTextBox" FontSize="{Binding FontSize}"> | ||
<ui:TextBox.Background> | ||
<SolidColorBrush Color="LightGoldenrodYellow" Opacity="0.7" /> | ||
</ui:TextBox.Background> | ||
</ui:TextBox> | ||
<ui:NumberBox ClearButtonEnabled="False" Grid.Row="2" Grid.Column="0" Value="{Binding FontSize,Mode=TwoWay}" MaxDecimalPlaces="0"> | ||
<ui:NumberBox.Background> | ||
<SolidColorBrush Color="AliceBlue" /> | ||
</ui:NumberBox.Background> | ||
</ui:NumberBox> | ||
|
||
|
||
</Grid> | ||
</ui:FluentWindow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Wpf.Ui.Controls; | ||
|
||
namespace Kitopia.View; | ||
|
||
public partial class LabelWindow : FluentWindow | ||
{ | ||
public LabelWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |