Commit e7c6700c authored by Francesco Carraro's avatar Francesco Carraro
Browse files

fixed sample data panel

parent 4cfb03d3
Loading
Loading
Loading
Loading
+216 KiB
Loading image diff...
+28 −0
Original line number Diff line number Diff line
@@ -9,6 +9,34 @@ using SpectrumModel = INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumMode

namespace INAF.Apps.Uwp.SLabDataManager.Converters
{
    public sealed class IsSpectrumLoadedConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            try
            {
                string _spectrumType = (string)parameter;
                SpectrumType spectrumType = _spectrumType.ToSpectrumType();

                SpectraContainer spectraContainer = Ioc.Default.GetService<SpectraContainer>();
                SpectrumModel spectrum = spectraContainer.tryGetSpectrumOfType(spectrumType);
                if (spectrum != null)
                    return true;
                else
                    return false;
            }
            catch (Exception)
            {
                return string.Empty;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }

    public sealed class IsSpectrumSavedOnCloudConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
+4 −0
Original line number Diff line number Diff line
@@ -137,6 +137,9 @@
    <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls">
      <Version>7.1.2</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Media">
      <Version>7.1.2</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.UI.Xaml">
      <Version>2.7.1</Version>
    </PackageReference>
@@ -328,6 +331,7 @@
    <Content Include="Assets\BadgeLogo.scale-150.png" />
    <Content Include="Assets\BadgeLogo.scale-200.png" />
    <Content Include="Assets\BadgeLogo.scale-400.png" />
    <Content Include="Assets\brushes\NoiseTexture.png" />
    <Content Include="Assets\icons\Error.png" />
    <Content Include="Assets\icons\Error_big.png" />
    <Content Include="Assets\icons\Ok.png" />
+4 −1
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@
    <value>Couldn't load values for describing current sample</value>
  </data>
  <data name="RefreshLabel.Text" xml:space="preserve">
    <value>Refresh</value>
    <value>Refresh values for describing sample data</value>
  </data>
  <data name="SampleDataGrainSizeLowerLimitLabel.Text" xml:space="preserve">
    <value>Lower limit (micron)</value>
@@ -456,4 +456,7 @@
  <data name="SaveSpectrumOfTypeSampleDataNameErrorMessage" xml:space="preserve">
    <value>A name for sample data is required.</value>
  </data>
  <data name="SampleDataClearValuesLabel.Text" xml:space="preserve">
    <value>Clear values</value>
  </data>
</root>
 No newline at end of file
+63 −1
Original line number Diff line number Diff line
@@ -3,7 +3,8 @@
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:converters="using:INAF.Apps.Uwp.SLabDataManager.Converters"
    xmlns:extconverters="using:INAF.Libraries.Uwp.Converters"
    xmlns:telerikPrimitivesCommon="using:Telerik.UI.Xaml.Controls.Primitives.Common">
    xmlns:telerikPrimitivesCommon="using:Telerik.UI.Xaml.Controls.Primitives.Common"
    xmlns:brushes="using:Microsoft.Toolkit.Uwp.UI.Media">

    <extconverters:BoolInverseConverter x:Key="BoolInverseConverter" />
    <extconverters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
@@ -11,6 +12,7 @@
    <converters:ChartDataPointConverter x:Key="ChartDataPointConverter" />
    <converters:ChartGridItemsVisibilityConverter x:Key="ChartGridItemsVisibilityConverter" />
    <converters:DoubleToIntConverter x:Key="DoubleToIntConverter" />
    <converters:IsSpectrumLoadedConverter x:Key="IsSpectrumLoadedConverter" />
    <converters:IsSpectrumSavedOnCloudConverter x:Key="IsSpectrumSavedOnCloudConverter" />
    <converters:HalfWidthConverter x:Key="HalfWidthConverter" />
    <converters:IsSpectrumAvailablelWithParameterConverter x:Key="IsSpectrumAvailablelWithParameterConverter" />
@@ -60,6 +62,52 @@
        <Setter Property="Template" Value="{StaticResource ChromelessButtonTemplate}" />
    </Style>

    <!-- CIRCLE BUTTON -->
    <Style x:Key="CircleButton" TargetType="Button">
        <Setter Property="BorderBrush" Value="{StaticResource myTextForeground}" />
        <Setter Property="BorderThickness" Value="10" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Disabled"/>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Inner" Storyboard.TargetProperty="(ScaleTransform.ScaleY)">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0.0" Value="1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Outer" Storyboard.TargetProperty="(ScaleTransform.ScaleY)">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0.0" Value="-1"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused"/>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Ellipse Margin="4" Fill="{TemplateBinding Background}" RenderTransformOrigin="0.5,0.5">
                            <Ellipse.RenderTransform>
                                <ScaleTransform ScaleY="1" x:Name="Outer"/>
                            </Ellipse.RenderTransform>
                        </Ellipse>
                        <Ellipse Margin="20" Fill="{TemplateBinding Background}" RenderTransformOrigin="0.5,0.5">
                            <Ellipse.RenderTransform>
                                <ScaleTransform ScaleY="-1" x:Name="Inner"/>
                            </Ellipse.RenderTransform>
                        </Ellipse>
                        <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- RADNUMERICBOX BUTTONS STYLE -->
    <Style TargetType="telerikPrimitivesCommon:InlineButton"
               x:Key="TelerikButtonStyle">
@@ -154,6 +202,13 @@
            <SolidColorBrush x:Key="myTransparentBackground" Color="#77000000" />
            <SolidColorBrush x:Key="myBorder" Color="White" />

            <brushes:AcrylicBrush x:Key="myAcrylicBrush"
                                  BackgroundSource="Backdrop"
                                  TintColor="Black"
                                  TintOpacity="0.1"
                                  BlurAmount="13"
                                  TextureUri="ms-appx:///Assets/brushes/NoiseTexture.png"/>
            
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ms-appx:///Telerik.UI.Xaml.Chart.UWP/Themes/ThemeResourcesDark.xaml" />
                <ResourceDictionary Source="ms-appx:///Telerik.UI.Xaml.DataVisualization.UWP/Themes/ThemeResourcesDark.xaml" />
@@ -169,6 +224,13 @@
            <SolidColorBrush x:Key="myTransparentBackground" Color="#77FFFFFF" />
            <SolidColorBrush x:Key="myBorder" Color="Black" />

            <brushes:AcrylicBrush x:Key="myAcrylicBrush"
                                  BackgroundSource="Backdrop"
                                  TintColor="AntiqueWhite"
                                  TintOpacity="0.1"
                                  BlurAmount="13"
                                  TextureUri="ms-appx:///Assets/brushes/NoiseTexture.png"/>
            
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ms-appx:///Telerik.UI.Xaml.Chart.UWP/Themes/ThemeResourcesLight.xaml" />
                <ResourceDictionary Source="ms-appx:///Telerik.UI.Xaml.DataVisualization.UWP/Themes/ThemeResourcesLight.xaml" />
Loading