Skip to content

Commit 5c31bc2

Browse files
committed
added the beta version of avalonia
1 parent 1e210e0 commit 5c31bc2

6 files changed

Lines changed: 47 additions & 14 deletions

File tree

.idea/.idea.CutCode/.idea/avalonia.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.CutCode/.idea/workspace.xml

Lines changed: 24 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AvaloniaEdit/AvaloniaEdit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="Avalonia" Version="0.10.11" />
36+
<PackageReference Include="Avalonia" Version="0.10.999-cibuild0017742-beta" />
3737
<PackageReference Include="System.Collections.Immutable" Version="1.6.0" />
3838
<PackageReference Include="System.Xml.ReaderWriter" Version="4.3.1" />
3939
</ItemGroup>

CutCode.CrossPlatform/CutCode.CrossPlatform.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<FileVersion>3.0.0</FileVersion>
1313
<NeutralLanguage>en-001</NeutralLanguage>
1414
<StartupObject>CutCode.CrossPlatform.Program</StartupObject>
15-
<AssemblyName></AssemblyName>
1615
<ApplicationIcon>Assets\Images\logo.ico</ApplicationIcon>
1716
</PropertyGroup>
1817
<ItemGroup>
@@ -28,11 +27,11 @@
2827
</ItemGroup>
2928
<ItemGroup>
3029
<PackageReference Include="Aura.UI" Version="0.1.5-dev-03" />
31-
<PackageReference Include="Avalonia" Version="0.10.11" />
32-
<PackageReference Include="Avalonia.Desktop" Version="0.10.11" />
30+
<PackageReference Include="Avalonia" Version="0.10.999-cibuild0017742-beta" />
31+
<PackageReference Include="Avalonia.Desktop" Version="0.10.999-cibuild0017742-beta" />
3332
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
34-
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.10" />
35-
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.11" />
33+
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.999-cibuild0017742-beta" />
34+
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.999-cibuild0017742-beta" />
3635
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
3736
<PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
3837
</ItemGroup>

CutCode.CrossPlatform/ViewModels/HomeViewModel.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,17 @@ public async void ComboBoxCommand(string sort)
168168
else
169169
{
170170
_languageSort = sort;
171-
var codes = await DataBase.OrderCode(_languageSort, allcodes);
172-
CodeModeToViewModel(await DataBase.OrderCode(_basicSort, codes));
171+
if(_isSearchCancelled)
172+
{
173+
var codes = await DataBase.OrderCode(_languageSort, DataBase.AllCodes);
174+
CodeModeToViewModel(await DataBase.OrderCode(_basicSort, codes));
175+
}
176+
else
177+
{
178+
var codes = await DataBase.SearchCode(_searchText, "Home");
179+
codes = await DataBase.OrderCode(_languageSort, codes);
180+
CodeModeToViewModel(await DataBase.OrderCode(_basicSort, codes));
181+
}
173182
}
174183
VisChange("Not found :(");
175184
}
@@ -181,8 +190,12 @@ public bool IsSearchBusy
181190
set => this.RaiseAndSetIfChanged(ref _isSearchBusy, value);
182191

183192
}
193+
194+
private string _searchText;
184195
public async void SearchCommand(string text)
185196
{
197+
_searchText = text;
198+
_isSearchCancelled = false;
186199
if (string.IsNullOrEmpty(text)) return;
187200
IsSearchBusy = true;
188201
if(text != "" && AllCodes.Count > 0)
@@ -194,11 +207,13 @@ public async void SearchCommand(string text)
194207
IsSearchBusy = false;
195208
}
196209

210+
private bool _isSearchCancelled = true;
197211
public async void SearchCancelled()
198212
{
199213
var codes = await DataBase.OrderCode(_languageSort, AllCodes.Select(c => c.Code).ToList());
200214
CodeModeToViewModel(await DataBase.OrderCode(_basicSort, codes));
201215
VisChange();
216+
_isSearchCancelled = true;
202217
}
203218
}
204219
}

CutCode.CrossPlatform/Views/AddView.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:exts="using:Aura.UI.ExtensionProperties"
65
xmlns:vm="using:CutCode.CrossPlatform.ViewModels"
76
xmlns:converters="clr-namespace:Avalonia.Markup.Xaml.Converters;assembly=Avalonia.Markup.Xaml"
87
xmlns:controllers="clr-namespace:CutCode.CrossPlatform.Controllers"

0 commit comments

Comments
 (0)