Merge pull request #69 from nventive/dev/cdb/history

History display
This commit is contained in:
David 2019-05-27 16:05:55 -04:00 committed by GitHub
commit 98e7f0dc47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 23 deletions

View file

@ -66,7 +66,7 @@
<PackageReference Include="Newtonsoft.Json"> <PackageReference Include="Newtonsoft.Json">
<Version>12.0.2</Version> <Version>12.0.2</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1595" /> <PackageReference Include="Uno.UI" Version="1.45.0-dev.1608" />
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.32" /> <PackageReference Include="Uno.UniversalImageLoader" Version="1.9.32" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" /> <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" /> <PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />

View file

@ -252,25 +252,41 @@ namespace CalculatorApp
ApplicationDataContainer GetHistoryContainer(CalculationManager.CALCULATOR_MODE cMode) ApplicationDataContainer GetHistoryContainer(CalculationManager.CALCULATOR_MODE cMode)
{ {
// TODO UNO
//ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
//ApplicationDataContainer historyContainer;
//// naming container based on mode
//string historyContainerKey = GetHistoryContainerKey(cMode);
//if (localSettings.Containers.ContainsKey(historyContainerKey))
//{
// historyContainer = localSettings.Containers[historyContainerKey];
//}
//else
//{
// // create container for adding data
// historyContainer = localSettings.CreateContainer(historyContainerKey, ApplicationDataCreateDisposition.Always);
// int initialHistoryVectorLength = 0;
// historyContainer.Values.Add(HistoryVectorLengthKey, initialHistoryVectorLength);
//}
//return historyContainer;
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
ApplicationDataContainer historyContainer; ApplicationDataContainer historyContainer = localSettings;
// naming container based on mode // naming container based on mode
string historyContainerKey = GetHistoryContainerKey(cMode); string historyContainerKey = GetHistoryContainerKey(cMode);
if (localSettings.Containers.ContainsKey(historyContainerKey)) if (!historyContainer.Values.ContainsKey(HistoryVectorLengthKey))
{ {
historyContainer = localSettings.Containers[historyContainerKey];
}
else
{
// create container for adding data
historyContainer = localSettings.CreateContainer(historyContainerKey, ApplicationDataCreateDisposition.Always);
int initialHistoryVectorLength = 0; int initialHistoryVectorLength = 0;
historyContainer.Values.Add(HistoryVectorLengthKey, initialHistoryVectorLength); historyContainer.Values.Add(HistoryVectorLengthKey, initialHistoryVectorLength);
} }
return historyContainer; return historyContainer;
} }
void ClearHistoryContainer(CalculationManager.CALCULATOR_MODE cMode) void ClearHistoryContainer(CalculationManager.CALCULATOR_MODE cMode)

View file

@ -9,7 +9,7 @@
<Version>4.3.1</Version> <Version>4.3.1</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Uno.UI"> <PackageReference Include="Uno.UI">
<Version>1.45.0-dev.1595</Version> <Version>1.45.0-dev.1608</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

View file

@ -44,7 +44,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" /> <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" /> <PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1595" /> <PackageReference Include="Uno.UI" Version="1.45.0-dev.1608" />
<PackageReference Include="Uno.Wasm.Bootstrap" Version="1.0.0-dev.281" /> <PackageReference Include="Uno.Wasm.Bootstrap" Version="1.0.0-dev.281" />
<DotNetCliToolReference Include="Uno.Wasm.Bootstrap.Cli" Version="1.0.0-dev.276" /> <DotNetCliToolReference Include="Uno.Wasm.Bootstrap.Cli" Version="1.0.0-dev.276" />
</ItemGroup> </ItemGroup>

View file

@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging;
using System; using System;
using Uno.Extensions; using Uno.Extensions;
using Windows.UI.Xaml; using Windows.UI.Xaml;
using Uno.UI;
namespace WindowsCalculator.Wasm namespace WindowsCalculator.Wasm
{ {
@ -14,6 +15,9 @@ namespace WindowsCalculator.Wasm
{ {
Console.WriteLine("Program.Main"); Console.WriteLine("Program.Main");
FeatureConfiguration.UIElement.AssignDOMXamlName = true;
Windows.UI.Xaml.Application.Start(_ => _app = new App()); Windows.UI.Xaml.Application.Start(_ => _app = new App());
} }
} }

View file

@ -208,7 +208,7 @@
<PackageReference Include="Newtonsoft.Json"> <PackageReference Include="Newtonsoft.Json">
<Version>12.0.2</Version> <Version>12.0.2</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1595" /> <PackageReference Include="Uno.UI" Version="1.45.0-dev.1608" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" /> <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" /> <PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
</ItemGroup> </ItemGroup>