-
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.
- Loading branch information
Showing
79 changed files
with
517 additions
and
373 deletions.
There are no files selected for viewing
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
Binary file not shown.
Binary file not shown.
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,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<ContentDialog | ||
x:Class="Polymerium.App.Dialogs.SwitchAccountDialog" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:models="using:Polymerium.App.Models" | ||
xmlns:local="using:Polymerium.App.Dialogs" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:toolkit="using:CommunityToolkit.WinUI.UI.Controls" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" Style="{StaticResource DefaultContentDialogStyle}" | ||
PrimaryButtonStyle="{StaticResource AccentButtonStyle}" | ||
Title="Select Account" PrimaryButtonText="Confirm" CloseButtonText="Cancel"> | ||
|
||
<Grid> | ||
<ListView ItemsSource="{x:Bind Candidates}" SelectedValue="{x:Bind Result,Mode=TwoWay}"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate x:DataType="models:AccountModel"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<Grid ColumnSpacing="{StaticResource SmallGap}" Padding="{StaticResource SmallMargin}"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<toolkit:ImageEx Grid.Column="0" | ||
Source="{x:Bind FaceUrl}" | ||
Width="36" /> | ||
<StackPanel Grid.Column="1"> | ||
<TextBlock Style="{StaticResource BodyStrongTextBlockStyle}" Text="{x:Bind Inner.Username}" /> | ||
<TextBlock Text="{x:Bind TypeName}" /> | ||
</StackPanel> | ||
</Grid> | ||
</Grid> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
</Grid> | ||
</ContentDialog> |
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 @@ | ||
// To learn more about WinUI, the WinUI project structure, | ||
// and more about our project templates, see: http://aka.ms/winui-project-info. | ||
|
||
using Microsoft.UI.Xaml; | ||
using Polymerium.App.Models; | ||
using System.Collections.Generic; | ||
|
||
namespace Polymerium.App.Dialogs | ||
{ | ||
public sealed partial class SwitchAccountDialog | ||
{ | ||
public IList<AccountModel> Candidates { get; } | ||
|
||
public static readonly DependencyProperty ResultProperty = DependencyProperty.Register( | ||
nameof(Result), typeof(AccountModel), typeof(SwitchAccountDialog), | ||
new PropertyMetadata(null)); | ||
|
||
public AccountModel? Result | ||
{ | ||
get { return (AccountModel?)GetValue(ResultProperty); } | ||
set { SetValue(ResultProperty, value); } | ||
} | ||
|
||
public SwitchAccountDialog(XamlRoot xamlRoot, IList<AccountModel> candidates) | ||
{ | ||
XamlRoot = xamlRoot; | ||
Candidates = candidates; | ||
|
||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
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
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.Windows.Input; | ||
|
||
namespace Polymerium.App.Models; | ||
|
||
public class DummyCommand : ICommand | ||
{ | ||
public static DummyCommand Instance { get; } = new(); | ||
public bool CanExecute(object? parameter) | ||
{ | ||
return true; | ||
} | ||
|
||
public void Execute(object? parameter) | ||
{ | ||
// do nothing | ||
} | ||
|
||
public event EventHandler? CanExecuteChanged; | ||
} |
Oops, something went wrong.