Loading INAF.Apps.Uwp.SLabDataManager/App.xaml.cs +2 −2 Original line number Diff line number Diff line using System; using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Models; using INAF.Apps.Uwp.SLabDataManager.Services; using INAF.Apps.Uwp.SLabDataManager.ViewModels; Loading @@ -11,6 +10,7 @@ using Microsoft.AppCenter.Analytics; using Microsoft.AppCenter.Crashes; using Microsoft.Extensions.DependencyInjection; using Microsoft.Toolkit.Mvvm.DependencyInjection; using System; using Windows.ApplicationModel.Activation; using Windows.UI.Xaml; Loading INAF.Apps.Uwp.SLabDataManager/Converters/Converters.cs +33 −3 Original line number Diff line number Diff line using System; using Windows.UI; using INAF.Apps.Uwp.SLabDataManager.Helpers; using System; using Telerik.Charting; using Windows.UI.Xaml; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media.Imaging; using INAF.Apps.Uwp.SLabDataManager.Helpers; using static INAF.Apps.Uwp.SLabDataManager.Constants.Enums; using INAF.Libraries.NetStandard.Extensions; using INAF.Apps.Uwp.SLabDataManager.Models; using Microsoft.Toolkit.Mvvm.DependencyInjection; namespace INAF.Apps.Uwp.SLabDataManager.Converters { public sealed class ChartDataPointConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { try { WorkingItemsModel workingItemsModel = Ioc.Default.GetService<WorkingItemsModel>(); ScatterDataPoint scatterDataPoint = value as ScatterDataPoint; return "ChartTooltipLabel".GetText() .Replace("rv_1", scatterDataPoint.XValue.ToString()) .Replace("rv_mu", workingItemsModel.Spectrum.SelectedWavelengthMeasureUnit.GetDescription()) .Replace("rv_2", scatterDataPoint.YValue.ToDoubleInvariant()); } catch (Exception) { return string.Empty; } } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } public sealed class StatusToImageConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) Loading INAF.Apps.Uwp.SLabDataManager/Models/WorkingItemsModel.cs +4 −0 Original line number Diff line number Diff line Loading @@ -35,11 +35,15 @@ namespace INAF.Apps.Uwp.SLabDataManager.Models } public SpectrumModel Spectrum { get; set; } public SpectrumSummaryModel SpectrumSummary { get; set; } #endregion #region methods private void init() { SpectrumSummary = new SpectrumSummaryModel(); RawSpectrumFilepath = "RawSpectrumFileNotSelectedMessage".GetText(); RawSpectrumReadingStatus = Status.None; Loading INAF.Apps.Uwp.SLabDataManager/Strings/en-us/Resources.resw +3 −6 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ <comment>Navigation view item name for Main</comment> </data> <data name="CartesianChart.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve"> <value>Bar chart showing purchases by each company</value> <value>Spectrum</value> <comment>Automation name (and description) for the chart page content</comment> </data> <data name="Shell_Chart.Content" xml:space="preserve"> Loading Loading @@ -209,10 +209,7 @@ <data name="SpectrumSummaryYAxisText" xml:space="preserve"> <value>Y axis range: [rv_1, rv_2] rv_3</value> </data> <data name="XaxisLabel" xml:space="preserve"> <value>nm</value> </data> <data name="YaxisLabel" xml:space="preserve"> <value>pipo</value> <data name="ChartTooltipLabel" xml:space="preserve"> <value>x,y: rv_1 rv_mu, rv_2</value> </data> </root> No newline at end of file INAF.Apps.Uwp.SLabDataManager/Styles/Custom.xaml +6 −5 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ <extconverters:BoolInverseConverter x:Key="BoolInverseConverter" /> <extconverters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> <extconverters:BoolToVisibilityInverseConverter x:Key="BoolToVisibilityInverseConverter" /> <converters:ChartDataPointConverter x:Key="ChartDataPointConverter" /> <converters:StatusToImageConverter x:Key="StatusToImageConverter" /> <converters:StatusToSolidColorBrushConverter x:Key="StatusToSolidColorBrushConverter" /> <converters:StatusToVisibilityConverter x:Key="StatusToVisibilityConverter" /> Loading @@ -27,8 +28,8 @@ <!-- APP THEMES --> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Dark"> <SolidColorBrush x:Key="myOkTextForeground" Color="White" /> <SolidColorBrush x:Key="myLogBorderBrush" Color="White" /> <SolidColorBrush x:Key="myTextForeground" Color="White" /> <SolidColorBrush x:Key="myTextBackground" Color="Black" /> <!--<SolidColorBrush x:Key="ExtendedSplashBackground" Color="{StaticResource CustomColor}" />--> <!--<Style TargetType="MediaPlayerElement" x:Key="MediaPlayerElementStyle"> Loading @@ -37,8 +38,8 @@ </ResourceDictionary> <ResourceDictionary x:Key="Light"> <SolidColorBrush x:Key="myOkTextForeground" Color="Black" /> <SolidColorBrush x:Key="myLogBorderBrush" Color="Black" /> <SolidColorBrush x:Key="myTextForeground" Color="Black" /> <SolidColorBrush x:Key="myTextBackground" Color="White" /> <!--<SolidColorBrush x:Key="ExtendedSplashBackground" Color="{StaticResource CustomColor}" />--> <!--<Style TargetType="MediaPlayerElement" x:Key="MediaPlayerElementStyle"> Loading @@ -47,7 +48,7 @@ </ResourceDictionary> <ResourceDictionary x:Key="Default"> <SolidColorBrush x:Key="myOkTextForeground" Color="Black" /> <SolidColorBrush x:Key="myTextForeground" Color="White" /> <SolidColorBrush x:Key="myLogBorderBrush" Color="Black" /> <!--<SolidColorBrush x:Key="ExtendedSplashBackground" Color="{StaticResource CustomColor}" />--> Loading Loading
INAF.Apps.Uwp.SLabDataManager/App.xaml.cs +2 −2 Original line number Diff line number Diff line using System; using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Models; using INAF.Apps.Uwp.SLabDataManager.Services; using INAF.Apps.Uwp.SLabDataManager.ViewModels; Loading @@ -11,6 +10,7 @@ using Microsoft.AppCenter.Analytics; using Microsoft.AppCenter.Crashes; using Microsoft.Extensions.DependencyInjection; using Microsoft.Toolkit.Mvvm.DependencyInjection; using System; using Windows.ApplicationModel.Activation; using Windows.UI.Xaml; Loading
INAF.Apps.Uwp.SLabDataManager/Converters/Converters.cs +33 −3 Original line number Diff line number Diff line using System; using Windows.UI; using INAF.Apps.Uwp.SLabDataManager.Helpers; using System; using Telerik.Charting; using Windows.UI.Xaml; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media.Imaging; using INAF.Apps.Uwp.SLabDataManager.Helpers; using static INAF.Apps.Uwp.SLabDataManager.Constants.Enums; using INAF.Libraries.NetStandard.Extensions; using INAF.Apps.Uwp.SLabDataManager.Models; using Microsoft.Toolkit.Mvvm.DependencyInjection; namespace INAF.Apps.Uwp.SLabDataManager.Converters { public sealed class ChartDataPointConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { try { WorkingItemsModel workingItemsModel = Ioc.Default.GetService<WorkingItemsModel>(); ScatterDataPoint scatterDataPoint = value as ScatterDataPoint; return "ChartTooltipLabel".GetText() .Replace("rv_1", scatterDataPoint.XValue.ToString()) .Replace("rv_mu", workingItemsModel.Spectrum.SelectedWavelengthMeasureUnit.GetDescription()) .Replace("rv_2", scatterDataPoint.YValue.ToDoubleInvariant()); } catch (Exception) { return string.Empty; } } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } public sealed class StatusToImageConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) Loading
INAF.Apps.Uwp.SLabDataManager/Models/WorkingItemsModel.cs +4 −0 Original line number Diff line number Diff line Loading @@ -35,11 +35,15 @@ namespace INAF.Apps.Uwp.SLabDataManager.Models } public SpectrumModel Spectrum { get; set; } public SpectrumSummaryModel SpectrumSummary { get; set; } #endregion #region methods private void init() { SpectrumSummary = new SpectrumSummaryModel(); RawSpectrumFilepath = "RawSpectrumFileNotSelectedMessage".GetText(); RawSpectrumReadingStatus = Status.None; Loading
INAF.Apps.Uwp.SLabDataManager/Strings/en-us/Resources.resw +3 −6 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ <comment>Navigation view item name for Main</comment> </data> <data name="CartesianChart.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve"> <value>Bar chart showing purchases by each company</value> <value>Spectrum</value> <comment>Automation name (and description) for the chart page content</comment> </data> <data name="Shell_Chart.Content" xml:space="preserve"> Loading Loading @@ -209,10 +209,7 @@ <data name="SpectrumSummaryYAxisText" xml:space="preserve"> <value>Y axis range: [rv_1, rv_2] rv_3</value> </data> <data name="XaxisLabel" xml:space="preserve"> <value>nm</value> </data> <data name="YaxisLabel" xml:space="preserve"> <value>pipo</value> <data name="ChartTooltipLabel" xml:space="preserve"> <value>x,y: rv_1 rv_mu, rv_2</value> </data> </root> No newline at end of file
INAF.Apps.Uwp.SLabDataManager/Styles/Custom.xaml +6 −5 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ <extconverters:BoolInverseConverter x:Key="BoolInverseConverter" /> <extconverters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> <extconverters:BoolToVisibilityInverseConverter x:Key="BoolToVisibilityInverseConverter" /> <converters:ChartDataPointConverter x:Key="ChartDataPointConverter" /> <converters:StatusToImageConverter x:Key="StatusToImageConverter" /> <converters:StatusToSolidColorBrushConverter x:Key="StatusToSolidColorBrushConverter" /> <converters:StatusToVisibilityConverter x:Key="StatusToVisibilityConverter" /> Loading @@ -27,8 +28,8 @@ <!-- APP THEMES --> <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Dark"> <SolidColorBrush x:Key="myOkTextForeground" Color="White" /> <SolidColorBrush x:Key="myLogBorderBrush" Color="White" /> <SolidColorBrush x:Key="myTextForeground" Color="White" /> <SolidColorBrush x:Key="myTextBackground" Color="Black" /> <!--<SolidColorBrush x:Key="ExtendedSplashBackground" Color="{StaticResource CustomColor}" />--> <!--<Style TargetType="MediaPlayerElement" x:Key="MediaPlayerElementStyle"> Loading @@ -37,8 +38,8 @@ </ResourceDictionary> <ResourceDictionary x:Key="Light"> <SolidColorBrush x:Key="myOkTextForeground" Color="Black" /> <SolidColorBrush x:Key="myLogBorderBrush" Color="Black" /> <SolidColorBrush x:Key="myTextForeground" Color="Black" /> <SolidColorBrush x:Key="myTextBackground" Color="White" /> <!--<SolidColorBrush x:Key="ExtendedSplashBackground" Color="{StaticResource CustomColor}" />--> <!--<Style TargetType="MediaPlayerElement" x:Key="MediaPlayerElementStyle"> Loading @@ -47,7 +48,7 @@ </ResourceDictionary> <ResourceDictionary x:Key="Default"> <SolidColorBrush x:Key="myOkTextForeground" Color="Black" /> <SolidColorBrush x:Key="myTextForeground" Color="White" /> <SolidColorBrush x:Key="myLogBorderBrush" Color="Black" /> <!--<SolidColorBrush x:Key="ExtendedSplashBackground" Color="{StaticResource CustomColor}" />--> Loading