Skip to content

Commit

Permalink
Add best price style
Browse files Browse the repository at this point in the history
  • Loading branch information
Triky313 committed Aug 8, 2019
1 parent 655321d commit 33ccb91
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
7 changes: 6 additions & 1 deletion StatisticsAnalysisTool/StatisticsAnalysisTool/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@
<!-- ######################################################################################### -->

<!-- Best Price Label -->
<Style TargetType="Label" x:Key="BestPriceLabel" >
<Style TargetType="Label" x:Key="ListView.Grid.StackPanel.Label.BestPrice" >
<Setter Property="Foreground" Value="{StaticResource SolidColorBrush.Foreground.First}"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="MinWidth" Value="100"/>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint = "1,0" MappingMode = "RelativeToBoundingBox" StartPoint = "0,0" Opacity = "0.5">
Expand Down Expand Up @@ -224,6 +228,7 @@
<Setter Property="Foreground" Value="{StaticResource SolidColorBrush.Foreground.First}"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="MinWidth" Value="100"/>
</Style>


Expand Down
4 changes: 2 additions & 2 deletions StatisticsAnalysisTool/StatisticsAnalysisTool/ItemWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<DataTemplate>
<Grid Style="{StaticResource ListView.Grid.Item.Price}">
<StackPanel Style="{StaticResource ListView.Grid.StackPanel.Item.Price}">
<Label Style="{StaticResource ListView.Grid.StackPanel.Label.Price}" Content="{Binding SellPriceMin}"/>
<Label Style="{Binding SellPriceMinStyle}" Content="{Binding SellPriceMin}"/>
</StackPanel>
<StackPanel Style="{StaticResource ListView.Grid.StackPanel.Item.Icon}">
<Image Style="{StaticResource ListView.Grid.StackPanel.Image.Price.Silver}"/>
Expand Down Expand Up @@ -109,7 +109,7 @@
<DataTemplate>
<Grid Style="{StaticResource ListView.Grid.Item.Price}">
<StackPanel Style="{StaticResource ListView.Grid.StackPanel.Item.Price}">
<Label Style="{StaticResource ListView.Grid.StackPanel.Label.Price}" Content="{Binding BuyPriceMax}"/>
<Label Style="{Binding BuyPriceMaxStyle}" Content="{Binding BuyPriceMax}"/>
</StackPanel>
<StackPanel Style="{StaticResource ListView.Grid.StackPanel.Item.Icon}">
<Image Style="{StaticResource ListView.Grid.StackPanel.Image.Price.Silver}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,38 @@ public Style CityStyle {
}
}

public Style SellPriceMinStyle
{
get
{
switch (BestSellMinPrice)
{
case true:
return Application.Current.FindResource("ListView.Grid.StackPanel.Label.BestPrice") as Style;
case false:
return Application.Current.FindResource("ListView.Grid.StackPanel.Label.Price") as Style;
default:
return Application.Current.FindResource("ListView.Grid.StackPanel.Label.Price") as Style;
}

}
}

public Style BuyPriceMaxStyle {
get
{
switch (BestBuyMaxPrice)
{
case true:
return Application.Current.FindResource("ListView.Grid.StackPanel.Label.BestPrice") as Style;
case false:
return Application.Current.FindResource("ListView.Grid.StackPanel.Label.Price") as Style;
default:
return Application.Current.FindResource("ListView.Grid.StackPanel.Label.Price") as Style;
}

}
}

}
}

0 comments on commit 33ccb91

Please sign in to comment.