FastLoginChannels

This commit is contained in:
Aigio Liu
2021-05-23 18:08:16 +08:00
parent 704cd5116c
commit 3d76038301
3 changed files with 31 additions and 22 deletions
@@ -252,9 +252,9 @@
M905.714286 694.285714q-22.285714 71.428571-70.285714 142.857143-73.714286 112-146.857143 112-28 0-80-18.285714-49.142857-18.285714-86.285714-18.285714-34.857143 0-81.142857 18.857143-46.285714 19.428571-75.428571 19.428571-86.857143 0-172-148-84-149.142857-84-287.428571 0-130.285714 64.571429-213.714286 64-82.285714 162.285714-82.285714 41.142857 0 101.142857 17.142857 59.428571 17.142857 78.857143 17.142857 25.714286 0 81.714286-19.428571 58.285714-19.428571 98.857143-19.428571 68 0 121.714286 37.142857 29.714286 20.571429 59.428571 57.142857-45.142857 38.285714-65.142857 67.428571-37.142857 53.714286-37.142857 118.285714 0 70.857143 39.428571 127.428571t90.285714 72zm-214.857143-670.285714q0 34.857143-16.571429 77.714286-17.142857 42.857143-53.142857 78.857143-30.857143 30.857143-61.714286 41.142857-21.142857 6.285714-59.428571 9.714286 1.714286-85.142857 44.571429-146.857143 42.285714-61.142857 142.857143-84.571429 0.571429 1.714286 1.428571 6.285714t1.428571 6.285714q0 2.285714 2.857143 5.714286t2.857143 5.714286z
</StreamGeometry>
<StreamGeometry x:Key="Microsoft">
<!--<StreamGeometry x:Key="Microsoft">
M0 32h214.6v214.6H0V32zm233.4 0H448v214.6H233.4V32zM0 265.4h214.6V480H0V265.4zm233.4 0H448V480H233.4V265.4z
</StreamGeometry>
</StreamGeometry>-->
<StreamGeometry x:Key="Xbox">
M369.9 318.2c44.3 54.3 64.7 98.8 54.4 118.7-7.9 15.1-56.7 44.6-92.6 55.9-29.6 9.3-68.4 13.3-100.4 10.2-38.2-3.7-76.9-17.4-110.1-39C93.3 445.8 87 438.3 87 423.4c0-29.9 32.9-82.3 89.2-142.1 32-33.9 76.5-73.7 81.4-72.6 9.4 2.1 84.3 75.1 112.3 109.5zM188.6 143.8c-29.7-26.9-58.1-53.9-86.4-63.4-15.2-5.1-16.3-4.8-28.7 8.1-29.2 30.4-53.5 79.7-60.3 122.4-5.4 34.2-6.1 43.8-4.2 60.5 5.6 50.5 17.3 85.4 40.5 120.9 9.5 14.6 12.1 17.3 9.3 9.9-4.2-11-.3-37.5 9.5-64 14.3-39 53.9-112.9 120.3-194.4zm311.6 63.5C483.3 127.3 432.7 77 425.6 77c-7.3 0-24.2 6.5-36 13.9-23.3 14.5-41 31.4-64.3 52.8C367.7 197 427.5 283.1 448.2 346c6.8 20.7 9.7 41.1 7.4 52.3-1.7 8.5-1.7 8.5 1.4 4.6 6.1-7.7 19.9-31.3 25.4-43.5 7.4-16.2 15-40.2 18.6-58.7 4.3-22.5 3.9-70.8-.8-93.4zM141.3 43C189 40.5 251 77.5 255.6 78.4c.7.1 10.4-4.2 21.6-9.7 63.9-31.1 94-25.8 107.4-25.2-63.9-39.3-152.7-50-233.9-11.7-23.4 11.1-24 11.9-9.4 11.2z
@@ -25,6 +25,7 @@
WindowStartupLocation="CenterOwner"
x:DataType="vm:LoginOrRegisterWindowViewModel"
x:CompileBindings="True"
x:Name="u"
Title="{Binding Title}">
<Window.Resources>
<converters:StringEqualsConverter x:Key="StringEqualsConverter" />
@@ -125,7 +126,7 @@
<StackPanel x:Name="FastLogin" Spacing="8">
<TextBlock Text="{ReflectionBinding Path=Res.User_FastLoginTip,Mode=OneWay,Source={x:Static resx:R.Current}}"></TextBlock>
<ListBox Background="Transparent" Items="{Binding FastLoginChannels}" SelectedIndex="{Binding FastLoginChannelsSelectedIndex}">
<ListBox Background="Transparent" Items="{Binding FastLoginChannels}">
<ListBox.Styles>
<Style Selector="ListBoxItem">
<Setter Property="MinHeight" Value="50"></Setter>
@@ -139,7 +140,15 @@
</ListBox.Styles>
<ListBox.ItemTemplate>
<DataTemplate x:CompileBindings="False">
<DockPanel>
<DockPanel x:Name="FastLoginChannelItem">
<i:Interaction.Behaviors>
<ia:EventTriggerBehavior EventName="Tapped"
SourceObject="{ReflectionBinding #FastLoginChannelItem}">
<ia:InvokeCommandAction
Command="{ReflectionBinding #u.DataContext.FastLogin}"
CommandParameter="{Binding}"/>
</ia:EventTriggerBehavior>
</i:Interaction.Behaviors>
<Panel DockPanel.Dock="Left">
<PathIcon Data="{StaticResource SteamDrawing}"
IsVisible="{Binding,Mode=OneWay,Converter={StaticResource StringEqualsConverter},ConverterParameter=Steam}" />
@@ -217,24 +217,24 @@ namespace System.Application.UI.ViewModels
FastLoginChannel.Apple,
};
int _FastLoginChannelsSelectedIndex = -1;
public int FastLoginChannelsSelectedIndex
{
get => _FastLoginChannelsSelectedIndex;
set
{
if (value > -1 && value < FastLoginChannels.Length)
{
var item = FastLoginChannels[value].ToString();
if (FastLogin.CanExecute(item))
{
FastLogin.Execute(item);
}
value = -1;
}
this.RaiseAndSetIfChanged(ref _FastLoginChannelsSelectedIndex, value);
}
}
//int _FastLoginChannelsSelectedIndex = -1;
//public int FastLoginChannelsSelectedIndex
//{
// get => _FastLoginChannelsSelectedIndex;
// set
// {
// if (value > -1 && value < FastLoginChannels.Length)
// {
// var item = FastLoginChannels[value].ToString();
// if (FastLogin.CanExecute(item))
// {
// FastLogin.Execute(item);
// }
// }
// this.RaiseAndSetIfChanged(ref _FastLoginChannelsSelectedIndex, value);
// this.RaiseAndSetIfChanged(ref _FastLoginChannelsSelectedIndex, -1);
// }
//}
protected override void Dispose(bool disposing)
{