-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Role select option & better MVVM bindings
Code clean up 👎 Co-Authored-By: ClaraaXD <102316295+ClaraaXD@users.noreply.github.com>
- Loading branch information
1 parent
d116efb
commit 4de4c33
Showing
52 changed files
with
2,404 additions
and
1,510 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
|
||
<Color x:Key="aPrimary">#7160E8</Color> | ||
<Color x:Key="aSecondary">#403582</Color> | ||
<Color x:Key="aTritary">#A093EF</Color> | ||
|
||
<!--<Color x:Key="aPrimary">#03A9F7</Color> | ||
<Color x:Key="aSecondary">#0076D1</Color> | ||
<Color x:Key="aTritary">#55ADF1</Color>--> | ||
<Color x:Key="bPrimary">#303030</Color> | ||
<Color x:Key="bSecondary">#18191C</Color> | ||
<Color x:Key="bTritary">#242424</Color> | ||
|
||
<Color x:Key="CheckMark">White</Color> | ||
<Color x:Key="title">white</Color> | ||
<Color x:Key="RedColor">#E74856</Color> | ||
|
||
<Color x:Key="FontPrimaryColor">Silver</Color> | ||
<Color x:Key="FontSecondaryColor">Gray</Color> | ||
<Color x:Key="FontTritaryColor">#969284</Color> | ||
|
||
<SolidColorBrush x:Key="RedBrush" Color="{DynamicResource RedColor}"/> | ||
<SolidColorBrush x:Key="BrushTitle" Color="{DynamicResource title}"/> | ||
<SolidColorBrush x:Key="aBrushPrimary" Color="{DynamicResource aPrimary}"/> | ||
<SolidColorBrush x:Key="aBrushSecondary" Color="{DynamicResource aSecondary}"/> | ||
<SolidColorBrush x:Key="aBrushTritary" Color="{DynamicResource aTritary}"/> | ||
<SolidColorBrush x:Key="bBrushPrimary" Color="{DynamicResource bPrimary}"/> | ||
<SolidColorBrush x:Key="bBrushSecondary" Color="{DynamicResource bSecondary}"/> | ||
<SolidColorBrush x:Key="bBrushTritary" Color="{DynamicResource bTritary}"/> | ||
|
||
<SolidColorBrush x:Key="BrushCheckMark" Color="{DynamicResource CheckMark}"/> | ||
|
||
<SolidColorBrush x:Key="FontPrimaryBrush" Color="{DynamicResource FontPrimaryColor}"/> | ||
<SolidColorBrush x:Key="FontSecondaryBrush" Color="{DynamicResource FontSecondaryColor}"/> | ||
<SolidColorBrush x:Key="FontTritaryBrush" Color="{DynamicResource FontTritaryColor}"/> | ||
|
||
<LinearGradientBrush x:Key="BorderGradientBrush" StartPoint="0,0" EndPoint="0,1"> | ||
<GradientStop Color="{DynamicResource aSecondary}" Offset="1"/> | ||
<GradientStop Color="{DynamicResource aPrimary}"/> | ||
</LinearGradientBrush> | ||
|
||
<LinearGradientBrush x:Key="SelectedBorderBrush" StartPoint="0,0" EndPoint="0,1"> | ||
<GradientStop x:Name="BorderBrushTop" Color="{DynamicResource aPrimary}" Offset="0"/> | ||
<GradientStop x:Name="BorderBrushBot" Color="{DynamicResource aTritary}" Offset="1"/> | ||
</LinearGradientBrush> | ||
|
||
<ControlTemplate x:Key="IconStyleButton" TargetType="{x:Type Button}"> | ||
<Grid Focusable="False" Cursor="Hand"> | ||
<Border x:Name="btnBorder" Width="12" Height="12" Background="Transparent" BorderBrush="Transparent" BorderThickness="0" SnapsToDevicePixels="true"> | ||
<Path Data="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" Stretch="Uniform"> | ||
<Path.Fill> | ||
<SolidColorBrush x:Name="IconBtnPathColor" Color="{DynamicResource FontSecondaryColor}"/> | ||
</Path.Fill> | ||
</Path> | ||
</Border> | ||
</Grid> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="IsEnabled" Value="False"> | ||
<Setter Property="Opacity" TargetName="btnBorder" Value="0.56"/> | ||
</Trigger> | ||
|
||
<EventTrigger RoutedEvent="UIElement.MouseEnter"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<ColorAnimation AutoReverse="False" Duration="0:0:0.2" Storyboard.TargetName="IconBtnPathColor" To="{StaticResource FontPrimaryColor}" Storyboard.TargetProperty="Color"/> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
<EventTrigger RoutedEvent="UIElement.PreviewMouseUp"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<ColorAnimation AutoReverse="True" Duration="0:0:0.05" Storyboard.TargetName="IconBtnPathColor" To="{StaticResource aPrimary}" Storyboard.TargetProperty="Color"/> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
<EventTrigger RoutedEvent="UIElement.MouseLeave"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<ColorAnimation AutoReverse="False" Duration="0:0:0.2" Storyboard.TargetName="IconBtnPathColor" To="{StaticResource FontSecondaryColor}" Storyboard.TargetProperty="Color"/> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
|
||
<ControlTemplate x:Key="IconStyleButtonRed" TargetType="{x:Type Button}"> | ||
<Grid Focusable="False" Cursor="Hand"> | ||
<Border x:Name="btnBorder" Width="12" Height="12" Background="Transparent" BorderBrush="Transparent" BorderThickness="0" SnapsToDevicePixels="true"> | ||
<Path Data="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" Stretch="Uniform"> | ||
<Path.Fill> | ||
<SolidColorBrush x:Name="IconBtnPathColor" Color="{DynamicResource FontSecondaryColor}"/> | ||
</Path.Fill> | ||
</Path> | ||
</Border> | ||
</Grid> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="IsEnabled" Value="False"> | ||
<Setter Property="Opacity" TargetName="btnBorder" Value="0.56"/> | ||
</Trigger> | ||
|
||
<EventTrigger RoutedEvent="UIElement.MouseEnter"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<ColorAnimation AutoReverse="False" Duration="0:0:0.2" Storyboard.TargetName="IconBtnPathColor" To="{StaticResource RedColor}" Storyboard.TargetProperty="Color"/> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
<EventTrigger RoutedEvent="UIElement.PreviewMouseUp"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<ColorAnimation AutoReverse="True" Duration="0:0:0.05" Storyboard.TargetName="IconBtnPathColor" To="{StaticResource FontSecondaryColor}" Storyboard.TargetProperty="Color"/> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
<EventTrigger RoutedEvent="UIElement.MouseLeave"> | ||
<BeginStoryboard> | ||
<Storyboard> | ||
<ColorAnimation AutoReverse="False" Duration="0:0:0.2" Storyboard.TargetName="IconBtnPathColor" To="{StaticResource FontSecondaryColor}" Storyboard.TargetProperty="Color"/> | ||
</Storyboard> | ||
</BeginStoryboard> | ||
</EventTrigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
|
||
namespace LoL_Assist_WAPP.Converters | ||
{ | ||
internal class NullToCollapseConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return string.IsNullOrEmpty(value?.ToString()) ? Visibility.Collapsed : Visibility.Visible; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
using System.Windows.Media; | ||
|
||
namespace LoL_Assist_WAPP.Converters | ||
{ | ||
public class TextToForegroundConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | ||
{ | ||
switch(value.ToString()) | ||
{ | ||
case "Declined": | ||
case "Disconnected": | ||
case "Invalid Build Config": | ||
return (SolidColorBrush)Application.Current.Resources["RedBrush"]; // Red | ||
case "Accepted": | ||
return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#29ab87")); // Green | ||
case "Auto Accept is disabled": | ||
return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#ffc40c")); // Yellow | ||
default: | ||
return (SolidColorBrush)Application.Current.Resources["FontPrimaryBrush"]; | ||
} | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:viewmodel="clr-namespace:LoL_Assist_WAPP.ViewModel" | ||
xmlns:view="clr-namespace:LoL_Assist_WAPP.View"> | ||
|
||
<DataTemplate DataType="{x:Type viewmodel:RoleSelectViewModel}"> | ||
<view:RoleSelectPanel/> | ||
</DataTemplate> | ||
|
||
<DataTemplate DataType="{x:Type viewmodel:PatchViewModel}"> | ||
<view:PatchNotesPanel/> | ||
</DataTemplate> | ||
|
||
<DataTemplate DataType="{x:Type viewmodel:MessageBoxViewModel}"> | ||
<view:MessageBox/> | ||
</DataTemplate> | ||
|
||
<DataTemplate DataType="{x:Type viewmodel:MatchFoundViewModel}"> | ||
<view:MatchFoundPanel/> | ||
</DataTemplate> | ||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Media.Animation; | ||
|
||
namespace LoL_Assist_WAPP.Extensions | ||
{ | ||
// Source: https://stackoverflow.com/questions/14485818/how-to-update-a-progress-bar-so-it-increases-smoothly | ||
public class ProgressBarSmoother | ||
{ | ||
public static double GetSmoothValue(DependencyObject obj) | ||
{ | ||
return (double)obj.GetValue(SmoothValueProperty); | ||
} | ||
|
||
public static void SetSmoothValue(DependencyObject obj, double value) | ||
{ | ||
obj.SetValue(SmoothValueProperty, value); | ||
} | ||
|
||
public static readonly DependencyProperty SmoothValueProperty = | ||
DependencyProperty.RegisterAttached("SmoothValue", typeof(double), typeof(ProgressBarSmoother), new PropertyMetadata(0.0, changing)); | ||
|
||
private static void changing(DependencyObject d, DependencyPropertyChangedEventArgs e) | ||
{ | ||
var anim = new DoubleAnimation((double)e.OldValue, (double)e.NewValue, TimeSpan.FromSeconds(1)); | ||
(d as ProgressBar).BeginAnimation(ProgressBar.ValueProperty, anim, HandoffBehavior.Compose); | ||
} | ||
} | ||
} |
Oops, something went wrong.