Add files via upload

This commit is contained in:
Kalakoi
2019-06-21 14:49:37 -04:00
committed by GitHub
parent 2b04353d53
commit d1b7974d42
50 changed files with 2401 additions and 0 deletions

18
src/App.config Normal file
View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Kalakoi.Xbox.App.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" />
</startup>
<userSettings>
<Kalakoi.Xbox.App.Properties.Settings>
<setting name="LastKey" serializeAs="String">
<value />
</setting>
</Kalakoi.Xbox.App.Properties.Settings>
</userSettings>
</configuration>

9
src/App.xaml Normal file
View File

@@ -0,0 +1,9 @@
<Application x:Class="Kalakoi.Xbox.App.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Kalakoi.Xbox.App"
StartupUri="Views/LauncherView.xaml">
<Application.Resources>
</Application.Resources>
</Application>

17
src/App.xaml.cs Normal file
View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace Kalakoi.Xbox.App
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

32
src/FriendSummary.xaml Normal file
View File

@@ -0,0 +1,32 @@
<UserControl x:Class="Kalakoi.Xbox.App.FriendSummary"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Kalakoi.Xbox.App"
mc:Ignorable="d"
x:Name="FriendSummaryView">
<Grid x:Name="FriendGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Ellipse Grid.Column="0" Width="60" Height="60" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="3">
<Ellipse.Fill>
<ImageBrush ImageSource="{Binding Path=Friend.ProfilePicture, ElementName=FriendSummaryView}" Stretch="UniformToFill"/>
</Ellipse.Fill>
</Ellipse>
<StackPanel Grid.Column="1">
<TextBlock Text="{Binding Path=Friend.Gamertag, ElementName=FriendSummaryView}" VerticalAlignment="Center" Margin="3"/>
<TextBlock Text="{Binding Path=Friend.Gamerscore, ElementName=FriendSummaryView}" VerticalAlignment="Center" Margin="3"/>
<TextBlock Text=" " Margin="3"/>
</StackPanel>
<StackPanel Grid.Column="2">
<CheckBox Content="Friend" IsChecked="{Binding Path=Friend.IsFriend, ElementName=FriendSummaryView}" VerticalAlignment="Center" Margin="3" IsEnabled="False"/>
<CheckBox Content="Follower" IsChecked="{Binding Path=Friend.IsFollower, ElementName=FriendSummaryView}" VerticalAlignment="Center" Margin="3" IsEnabled="False"/>
</StackPanel>
<TextBlock Text="{Binding Path=Friend.PresenceState, ElementName=FriendSummaryView}" Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Right" TextAlignment="Right" Margin="3"/>
<TextBlock Text="{Binding Path=Friend.PresenceText, ElementName=FriendSummaryView}" Grid.Column="1" Grid.ColumnSpan="2" VerticalAlignment="Bottom" Margin="3"/>
</Grid>
</UserControl>

76
src/FriendSummary.xaml.cs Normal file
View File

@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
/// <summary>
/// Interaction logic for FriendSummary.xaml
/// </summary>
public partial class FriendSummary : UserControl
{
public FriendSummary()
{
InitializeComponent();
}
public Friend Friend
{
get { return (Friend)GetValue(FriendProperty); }
set { SetValue(FriendProperty, value); }
}
public static DependencyProperty FriendProperty =
DependencyProperty.Register(nameof(Friend), typeof(Friend), typeof(FriendSummary));
/*
public Uri ProfilePicture
{
get { return (Uri)GetValue(ProfilePictureProperty); }
set { SetValue(ProfilePictureProperty, value); }
}
public string Gamertag
{
get { return (string)GetValue(GamertagProperty); }
set { SetValue(GamertagProperty, value); }
}
public string Status
{
get { return (string)GetValue(StatusProperty); }
set { SetValue(StatusProperty, value); }
}
public string Presence
{
get { return (string)GetValue(PresenceProperty); }
set { SetValue(PresenceProperty, value); }
}
public static DependencyProperty ProfilePictureProperty =
DependencyProperty.Register(nameof(ProfilePicture), typeof(Uri), typeof(FriendSummary));
public static DependencyProperty GamertagProperty =
DependencyProperty.Register(nameof(Gamertag), typeof(string), typeof(FriendSummary));
public static DependencyProperty StatusProperty =
DependencyProperty.Register(nameof(Status), typeof(string), typeof(FriendSummary));
public static DependencyProperty PresenceProperty =
DependencyProperty.Register(nameof(Presence), typeof(string), typeof(FriendSummary));
*/
}
}

199
src/Kalakoi.Xbox.App.csproj Normal file
View File

@@ -0,0 +1,199 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F3BEB689-21F7-4B9A-80F2-C44677DA5900}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Kalakoi.Xbox.App</RootNamespace>
<AssemblyName>Kalakoi.Xbox.App</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="FriendSummary.xaml.cs">
<DependentUpon>FriendSummary.xaml</DependentUpon>
</Compile>
<Compile Include="Models\LauncherModel.cs" />
<Compile Include="TestFriendModel.cs" />
<Compile Include="TestFriendView.xaml.cs">
<DependentUpon>TestFriendView.xaml</DependentUpon>
</Compile>
<Compile Include="TestFriendViewModel.cs" />
<Compile Include="Views\LauncherView.xaml.cs">
<DependentUpon>LauncherView.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\LauncherViewModel.cs" />
<Compile Include="Models\MassMessageModel.cs" />
<Compile Include="Views\MassMessageView.xaml.cs">
<DependentUpon>MassMessageView.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\MassMessageViewModel.cs" />
<Compile Include="Models\InputBoxModel.cs" />
<Compile Include="Views\InputBoxView.xaml.cs">
<DependentUpon>InputBoxView.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\InputBoxViewModel.cs" />
<Compile Include="Views\ConversationView.xaml.cs">
<DependentUpon>ConversationView.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\ConversationViewModel.cs" />
<Compile Include="Models\ConversationModel.cs" />
<Compile Include="Models\FriendsListModel.cs" />
<Compile Include="Views\FriendsListView.xaml.cs">
<DependentUpon>FriendsListView.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\FriendsListViewModel.cs" />
<Compile Include="Models\MainWindowModel.cs" />
<Compile Include="ViewModels\MainWindowViewModel.cs" />
<Compile Include="Models\MessengerModel.cs" />
<Compile Include="Views\MessengerView.xaml.cs">
<DependentUpon>MessengerView.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\MessengerViewModel.cs" />
<Compile Include="MVVM\PropertyChangedBase.cs" />
<Compile Include="MVVM\RelayCommand.cs" />
<Page Include="FriendSummary.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="TestFriendView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\LauncherView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\MassMessageView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\InputBoxView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ConversationView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\FriendsListView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Views\MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Views\MessengerView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ProfileViewerView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="MVVM\ModelBase.cs" />
<Compile Include="Models\ProfileViewerModel.cs" />
<Compile Include="Views\ProfileViewerView.xaml.cs">
<DependentUpon>ProfileViewerView.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\ProfileViewerViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Kalakoi.Xbox.OpenXBL\Kalakoi.Xbox.OpenXBL.csproj">
<Project>{c1a3c6a1-4817-42c7-986a-2f51f223cfea}</Project>
<Name>Kalakoi.Xbox.OpenXBL</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="UserControls\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

19
src/MVVM/ModelBase.cs Normal file
View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kalakoi.Xbox.App
{
public abstract class ModelBase : PropertyChangedBase
{
public void SetProperty<T>(ref T storage, T value, string name)
{
if ((storage?.GetType() != value?.GetType()) && storage != null && value != null)
throw new InvalidCastException("Nexthermal.CodeBase.WPF.ModelBase.UpdateProperty\nVariable type mismatch between storage and value.");
storage = value;
OnPropertyChanged(name);
}
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Kalakoi.Xbox.App
{
public abstract class PropertyChangedBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string name) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}

39
src/MVVM/RelayCommand.cs Normal file
View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
namespace Kalakoi.Xbox.App
{
public class RelayCommand : ICommand
{
private Action<object> execute;
private Func<object, bool> canExecute;
public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public RelayCommand(Action<object> execute, Func<object, bool> canExecute = null)
{
this.execute = execute;
this.canExecute = canExecute;
}
public bool CanExecute(object parameter)
{
return this.canExecute == null || this.canExecute(parameter);
}
public void Execute(object parameter)
{
this.execute(parameter);
}
}
}

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public abstract class ConversationModel : ModelBase
{
private string _gamertag;
private string _xuid;
private Conversation _conversation;
private ICommand _refreshList;
private ICommand _sendReply;
public string Gamertag
{
get { return _gamertag; }
set { SetProperty(ref _gamertag, value, nameof(Gamertag)); OnPropertyChanged(nameof(Title)); }
}
public string Title => string.Format("Conversation with {0}", Gamertag);
public string xuid
{
get { return _xuid; }
set { SetProperty(ref _xuid, value, nameof(xuid)); }
}
public Conversation Conversation
{
get { return _conversation; }
set { SetProperty(ref _conversation, value, nameof(Conversation)); }
}
public ICommand RefreshList
{
get { return _refreshList; }
set { SetProperty(ref _refreshList, value, nameof(RefreshList)); }
}
public ICommand SendReply
{
get { return _sendReply; }
set { SetProperty(ref _sendReply, value, nameof(SendReply)); }
}
}
}

View File

@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public abstract class FriendsListModel : ModelBase
{
private string _gamertag;
private string _xuid;
private List<Friend> _friends;
private int _selectedFriendIndex;
public string Gamertag
{
get { return _gamertag; }
set { SetProperty(ref _gamertag, value, nameof(Gamertag)); OnPropertyChanged(nameof(Title)); }
}
public string Title => string.Format("{0}'s Friends List", Gamertag);
public string xuid
{
get { return _xuid; }
set { SetProperty(ref _xuid, value, nameof(xuid)); }
}
public List<Friend> Friends
{
get { return _friends; }
set { SetProperty(ref _friends, value, nameof(Friends)); SelectedFriendIndex = -1; }
}
public int SelectedFriendIndex
{
get { return _selectedFriendIndex; }
set { SetProperty(ref _selectedFriendIndex, value, nameof(SelectedFriendIndex)); OnPropertyChanged(nameof(FriendSelected)); }
}
public bool FriendSelected => SelectedFriendIndex >= 0;
private ICommand _addFriend;
private ICommand _removeFriend;
private ICommand _favoriteFriend;
private ICommand _unfavoriteFriend;
private ICommand _viewProfile;
private ICommand _viewFriends;
private ICommand _refreshList;
private ICommand _sendMessage;
public ICommand AddFriend
{
get { return _addFriend; }
set { SetProperty(ref _addFriend, value, nameof(AddFriend)); }
}
public ICommand RemoveFriend
{
get { return _removeFriend; }
set { SetProperty(ref _removeFriend, value, nameof(RemoveFriend)); }
}
public ICommand FavoriteFriend
{
get { return _favoriteFriend; }
set { SetProperty(ref _favoriteFriend, value, nameof(FavoriteFriend)); }
}
public ICommand UnfavoriteFriend
{
get { return _unfavoriteFriend; }
set { SetProperty(ref _unfavoriteFriend, value, nameof(UnfavoriteFriend)); }
}
public ICommand ViewProfile
{
get { return _viewProfile; }
set { SetProperty(ref _viewProfile, value, nameof(ViewProfile)); }
}
public ICommand ViewFriends
{
get { return _viewFriends; }
set { SetProperty(ref _viewFriends, value, nameof(ViewFriends)); }
}
public ICommand RefreshList
{
get { return _refreshList; }
set { SetProperty(ref _refreshList, value, nameof(RefreshList)); }
}
public ICommand SendMessage
{
get { return _sendMessage; }
set { SetProperty(ref _sendMessage, value, nameof(SendMessage)); }
}
}
}

View File

@@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
namespace Kalakoi.Xbox.App
{
public abstract class InputBoxModel : ModelBase
{
private string _title;
private string _prompt;
private string _input;
private MessageBoxButton _buttons;
private MessageBoxResult _result;
private ICommand _ok;
private ICommand _cancel;
private ICommand _yes;
private ICommand _no;
public string Title
{
get { return _title; }
set { SetProperty(ref _title, value, nameof(Title)); }
}
public string Prompt
{
get { return _prompt; }
set { SetProperty(ref _prompt, value, nameof(Prompt)); }
}
public string Input
{
get { return _input; }
set { SetProperty(ref _input, value, nameof(Input)); }
}
public MessageBoxButton Buttons
{
get { return _buttons; }
set
{
SetProperty(ref _buttons, value, nameof(Buttons));
OnPropertyChanged(nameof(OKVisible));
OnPropertyChanged(nameof(CancelVisible));
OnPropertyChanged(nameof(YesNoVisible));
}
}
public MessageBoxResult Result
{
get { return _result; }
set { SetProperty(ref _result, value, nameof(Result)); }
}
public Visibility OKVisible =>
Buttons == MessageBoxButton.OK || Buttons == MessageBoxButton.OKCancel ?
Visibility.Visible :
Visibility.Collapsed;
public Visibility CancelVisible =>
Buttons == MessageBoxButton.OKCancel || Buttons == MessageBoxButton.YesNoCancel ?
Visibility.Visible :
Visibility.Collapsed;
public Visibility YesNoVisible =>
Buttons == MessageBoxButton.YesNo || Buttons == MessageBoxButton.YesNoCancel ?
Visibility.Visible :
Visibility.Collapsed;
public ICommand OK
{
get { return _ok; }
set { SetProperty(ref _ok, value, nameof(OK)); }
}
public ICommand Cancel
{
get { return _cancel; }
set { SetProperty(ref _cancel, value, nameof(Cancel)); }
}
public ICommand Yes
{
get { return _yes; }
set { SetProperty(ref _yes, value, nameof(Yes)); }
}
public ICommand No
{
get { return _no; }
set { SetProperty(ref _no, value, nameof(No)); }
}
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Kalakoi.Xbox.App
{
public abstract class LauncherModel : ModelBase
{
private string _key;
private ICommand _launch;
public string Key
{
get { return _key; }
set { SetProperty(ref _key, value, nameof(Key)); }
}
public ICommand Launch
{
get { return _launch; }
set { SetProperty(ref _launch, value, nameof(Launch)); }
}
}
}

View File

@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Kalakoi.Xbox.App
{
public abstract class MainWindowModel : ModelBase
{
private string _response;
private ICommand _viewProfile;
private ICommand _viewFriends;
private ICommand _viewMessages;
private ICommand _viewMassMessage;
private ICommand _command;
public string Response
{
get { return _response; }
set { SetProperty(ref _response, value, nameof(Response)); }
}
public ICommand ViewProfile
{
get { return _viewProfile; }
set { SetProperty(ref _viewProfile, value, nameof(ViewProfile)); }
}
public ICommand ViewFriends
{
get { return _viewFriends; }
set { SetProperty(ref _viewFriends, value, nameof(ViewFriends)); }
}
public ICommand ViewMessages
{
get { return _viewMessages; }
set { SetProperty(ref _viewMessages, value, nameof(ViewMessages)); }
}
public ICommand ViewMassMessage
{
get { return _viewMassMessage; }
set { SetProperty(ref _viewMassMessage, value, nameof(ViewMassMessage)); }
}
public ICommand Command
{
get { return _command; }
set { SetProperty(ref _command, value, nameof(Command)); }
}
}
}

View File

@@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public abstract class MassMessageModel : ModelBase
{
private List<Friend> _friends;
private int _friendIndex;
private List<Friend> _selectedFriends;
private int _selectedFriendIndex;
private string _message;
private bool _individualMessages;
private ICommand _addSelected;
private ICommand _addAll;
private ICommand _removeSelected;
private ICommand _removeAll;
private ICommand _sendMessage;
public List<Friend> Friends
{
get { return _friends; }
set { SetProperty(ref _friends, value, nameof(Friends)); FriendIndex = -1; }
}
public int FriendIndex
{
get { return _friendIndex; }
set { SetProperty(ref _friendIndex, value, nameof(FriendIndex)); }
}
public List<Friend> SelectedFriends
{
get { return _selectedFriends; }
set { SetProperty(ref _selectedFriends, value, nameof(SelectedFriends)); }
}
public int SelectedFriendIndex
{
get { return _selectedFriendIndex; }
set { SetProperty(ref _selectedFriendIndex, value, nameof(SelectedFriendIndex)); }
}
public string Message
{
get { return _message; }
set { SetProperty(ref _message, value, nameof(Message)); }
}
public bool IndividualMessages
{
get { return _individualMessages; }
set { SetProperty(ref _individualMessages, value, nameof(IndividualMessages)); }
}
public ICommand AddSelected
{
get { return _addSelected; }
set { SetProperty(ref _addSelected, value, nameof(AddSelected)); }
}
public ICommand AddAll
{
get { return _addAll; }
set { SetProperty(ref _addAll, value, nameof(AddAll)); }
}
public ICommand RemoveSelected
{
get { return _removeSelected; }
set { SetProperty(ref _removeSelected, value, nameof(RemoveSelected)); }
}
public ICommand RemoveAll
{
get { return _removeAll; }
set { SetProperty(ref _removeAll, value, nameof(RemoveAll)); }
}
public ICommand SendMessage
{
get { return _sendMessage; }
set { SetProperty(ref _sendMessage, value, nameof(SendMessage)); }
}
}
}

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public abstract class MessengerModel : ModelBase
{
private List<ConversationSummary> _conversations;
private int _selectedConversationIndex;
public List<ConversationSummary> Conversations
{
get { return _conversations; }
set { SetProperty(ref _conversations, value, nameof(Conversations)); SelectedConversationIndex = -1; }
}
public int SelectedConversationIndex
{
get { return _selectedConversationIndex; }
set { SetProperty(ref _selectedConversationIndex, value, nameof(SelectedConversationIndex)); OnPropertyChanged(nameof(ConversationSelected)); }
}
public bool ConversationSelected => SelectedConversationIndex >= 0;
private ICommand _viewConversation;
private ICommand _refreshList;
private ICommand _sendReply;
public ICommand ViewConversation
{
get { return _viewConversation; }
set { SetProperty(ref _viewConversation, value, nameof(ViewConversation)); }
}
public ICommand RefreshList
{
get { return _refreshList; }
set { SetProperty(ref _refreshList, value, nameof(RefreshList)); }
}
public ICommand SendReply
{
get { return _sendReply; }
set { SetProperty(ref _sendReply, value, nameof(SendReply)); }
}
}
}

View File

@@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public abstract class ProfileViewerModel : ModelBase
{
private XboxProfile _profile;
private Uri _profilePicture;
private string _gamertag;
private int _gamerscore;
private string _bio;
private string _location;
private string _tier;
private string _reputation;
private string _realName;
private Brush _primary;
private Brush _secondary;
private Brush _tertiary;
public XboxProfile Profile
{
get { return _profile; }
set
{
SetProperty(ref _profile, value, nameof(Profile));
if (value == null)
{
ProfilePicture = null;
Gamertag = string.Empty;
Gamerscore = 0;
Bio = string.Empty;
Location = string.Empty;
Tier = string.Empty;
Reputation = string.Empty;
RealName = string.Empty;
Primary = new SolidColorBrush(Colors.White);
Secondary = new SolidColorBrush(Colors.White);
Tertiary = new SolidColorBrush(Colors.White);
}
else
{
ProfilePicture = value.GamerPic;
Gamertag = value.Gamertag;
Gamerscore = value.Gamerscore;
Bio = value.Bio;
Location = value.Location;
Tier = value.AccountTier;
Reputation = value.Reputation;
RealName = value.RealName;
Primary = new SolidColorBrush((Color)ColorConverter.ConvertFromString(string.Format("#{0}", value.PreferredColor.PrimaryColor)));
Secondary = new SolidColorBrush((Color)ColorConverter.ConvertFromString(string.Format("#{0}", value.PreferredColor.SecondaryColor)));
Tertiary = new SolidColorBrush((Color)ColorConverter.ConvertFromString(string.Format("#{0}", value.PreferredColor.TertiaryColor)));
}
}
}
public Uri ProfilePicture
{
get { return _profilePicture; }
set { SetProperty(ref _profilePicture, value, nameof(ProfilePicture)); }
}
public string Gamertag
{
get { return _gamertag; }
set { SetProperty(ref _gamertag, value, nameof(Gamertag)); }
}
public int Gamerscore
{
get { return _gamerscore; }
set { SetProperty(ref _gamerscore, value, nameof(Gamerscore)); }
}
public string Bio
{
get { return _bio; }
set { SetProperty(ref _bio, value, nameof(Bio)); }
}
public string Location
{
get { return _location; }
set { SetProperty(ref _location, value, nameof(Location)); }
}
public string Tier
{
get { return _tier; }
set { SetProperty(ref _tier, value, nameof(Tier)); }
}
public string Reputation
{
get { return _reputation; }
set { SetProperty(ref _reputation, value, nameof(Reputation)); }
}
public string RealName
{
get { return _realName; }
set { SetProperty(ref _realName, value, nameof(RealName)); }
}
public Brush Primary
{
get { return _primary; }
set { SetProperty(ref _primary, value, nameof(Primary)); }
}
public Brush Secondary
{
get { return _secondary; }
set { SetProperty(ref _secondary, value, nameof(Secondary)); }
}
public Brush Tertiary
{
get { return _tertiary; }
set { SetProperty(ref _tertiary, value, nameof(Tertiary)); }
}
}
}

View File

@@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Kalakoi.Xbox.App")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Kalakoi.Xbox.App")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

71
src/Properties/Resources.Designer.cs generated Normal file
View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Kalakoi.Xbox.App.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Kalakoi.Xbox.App.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

38
src/Properties/Settings.Designer.cs generated Normal file
View File

@@ -0,0 +1,38 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Kalakoi.Xbox.App.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string LastKey {
get {
return ((string)(this["LastKey"]));
}
set {
this["LastKey"] = value;
}
}
}
}

View File

@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Kalakoi.Xbox.App.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="LastKey" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

27
src/TestFriendModel.cs Normal file
View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public abstract class TestFriendModel : ModelBase
{
private List<Friend> _friendsList;
private int _selectedFriendIndex;
public List<Friend> FriendsList
{
get { return _friendsList; }
set { SetProperty(ref _friendsList, value, nameof(FriendsList)); SelectedFriendIndex = -1; }
}
public int SelectedFriendIndex
{
get { return _selectedFriendIndex; }
set { SetProperty(ref _selectedFriendIndex, value, nameof(SelectedFriendIndex)); }
}
}
}

25
src/TestFriendView.xaml Normal file
View File

@@ -0,0 +1,25 @@
<Window x:Class="Kalakoi.Xbox.App.TestFriendView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Kalakoi.Xbox.App"
mc:Ignorable="d"
Title="TestFriendView" Height="600" Width="300" SizeToContent="Width">
<Window.DataContext>
<local:TestFriendViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<ListView ItemsSource="{Binding FriendsList, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding SelectedFriendIndex, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Margin="3">
<ListView.ItemTemplate>
<DataTemplate>
<local:FriendSummary Friend="{Binding}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Window>

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Kalakoi.Xbox.App
{
/// <summary>
/// Interaction logic for TestFriendView.xaml
/// </summary>
public partial class TestFriendView : Window
{
public TestFriendView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public class TestFriendViewModel : TestFriendModel
{
public TestFriendViewModel()
{
InitializeVariables();
InitializeCommands();
}
private void InitializeVariables()
{
FriendsList = new List<Friend>(XboxConnection.GetFriends());
}
private void InitializeCommands()
{
}
}
}

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public class ConversationViewModel : ConversationModel
{
public ConversationViewModel()
{
InitializeVariables();
InitializeCommands();
}
private void InitializeVariables()
{
Gamertag = "Xbox Live";
xuid = "0";
Conversation = new Conversation() { Summary = new ConversationSummary(), Messages = new List<Message>() { new Message() } };
}
private void InitializeCommands()
{
RefreshList = new RelayCommand(ListRefresh);
SendReply = new RelayCommand(ReplySend);
}
private void ListRefresh(object obj)
{
Conversation = XboxConnection.GetConversation(xuid);
}
private void ReplySend(object obj)
{
string MessageText = string.Empty;
MessageBoxResult res = InputBoxView.ShowDialog(string.Format("New message to {0}", Gamertag), "Message:", out MessageText, MessageBoxButton.OKCancel);
if (res == MessageBoxResult.OK)
XboxConnection.SendMessage(Gamertag, MessageText);
}
}
}

View File

@@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public class FriendsListViewModel : FriendsListModel
{
public FriendsListViewModel()
{
InitializeVariables();
InitializeCommands();
}
private void InitializeVariables()
{
Gamertag = string.Empty;
xuid = string.Empty;
Friends = new List<Friend>();
}
private void InitializeCommands()
{
RefreshList = new RelayCommand(ListRefresh);
ViewProfile = new RelayCommand(ProfileView);
ViewFriends = new RelayCommand(FriendsView);
RemoveFriend = new RelayCommand(FriendRemove);
AddFriend = new RelayCommand(FriendAdd);
FavoriteFriend = new RelayCommand(FriendFavorite);
UnfavoriteFriend = new RelayCommand(FriendUnfavorite);
SendMessage = new RelayCommand(MessageSend);
}
private void ListRefresh(object obj)
{
Friends = new List<Friend>(XboxConnection.GetFriends(xuid));
}
private void ProfileView(object obj)
{
XboxProfile Profile = XboxConnection.GetProfile(Friends.ElementAt(SelectedFriendIndex).Gamertag);
ProfileViewerView v = new ProfileViewerView(Profile);
v.Show();
}
private void FriendsView(object obj)
{
FriendsListView v = new FriendsListView(Friends.ElementAt(SelectedFriendIndex).Gamertag, Friends.ElementAt(SelectedFriendIndex).xuid);
v.Show();
}
private void FriendRemove(object obj)
{
XboxConnection.RemoveFriend(Friends.ElementAt(SelectedFriendIndex).xuid);
}
private void FriendAdd(object obj)
{
string Gamertag = string.Empty;
MessageBoxResult res = InputBoxView.ShowDialog("Send Friend Request", "Gamertag to Add:", out Gamertag, MessageBoxButton.OKCancel);
if (res == MessageBoxResult.OK)
XboxConnection.AddFriend(XboxConnection.XuidFromGamertag(Gamertag));
}
private void FriendFavorite(object obj)
{
XboxConnection.FavoriteFriend(Friends.ElementAt(SelectedFriendIndex).xuid);
}
private void FriendUnfavorite(object obj)
{
XboxConnection.UnfavoriteFriend(Friends.ElementAt(SelectedFriendIndex).xuid);
}
private void MessageSend(object obj)
{
string MessageText = string.Empty;
MessageBoxResult res = InputBoxView.ShowDialog(string.Format("New message to {0}", Friends.ElementAt(SelectedFriendIndex).Gamertag), "Message:", out MessageText, MessageBoxButton.OKCancel);
if (res == MessageBoxResult.OK)
XboxConnection.SendMessage(Friends.ElementAt(SelectedFriendIndex).Gamertag, MessageText);
}
}
}

View File

@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Kalakoi.Xbox.App
{
public class InputBoxViewModel : InputBoxModel
{
public InputBoxViewModel()
{
InitializeVariables();
InitializeCommands();
}
private void InitializeVariables()
{
Title = string.Empty;
Prompt = string.Empty;
Input = string.Empty;
Buttons = MessageBoxButton.OK;
Result = MessageBoxResult.None;
}
private void InitializeCommands()
{
OK = new RelayCommand(OKClick);
Cancel = new RelayCommand(CancelClick);
Yes = new RelayCommand(YesClick);
No = new RelayCommand(NoClick);
}
private void OKClick(object obj)
{
Result = MessageBoxResult.OK;
Application.Current.Windows.OfType<InputBoxView>().First().Close();
}
private void CancelClick(object obj)
{
Result = MessageBoxResult.Cancel;
Application.Current.Windows.OfType<InputBoxView>().First().Close();
}
private void YesClick(object obj)
{
Result = MessageBoxResult.Yes;
Application.Current.Windows.OfType<InputBoxView>().First().Close();
}
private void NoClick(object obj)
{
Result = MessageBoxResult.No;
Application.Current.Windows.OfType<InputBoxView>().First().Close();
}
public void SetBox(string Title, string Prompt, MessageBoxButton Buttons)
{
this.Title = Title;
this.Prompt = Prompt;
this.Buttons = Buttons;
Input = string.Empty;
}
}
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public class LauncherViewModel : LauncherModel
{
public LauncherViewModel()
{
InitializeVariables();
InitializeCommands();
}
private void InitializeVariables()
{
Key = Properties.Settings.Default.LastKey;
}
private void InitializeCommands()
{
Launch = new RelayCommand(DoLaunch);
}
private void DoLaunch(object obj)
{
Properties.Settings.Default.LastKey = Key;
Properties.Settings.Default.Save();
XboxConnection.SetApiKey(Key);
MainWindow v = new MainWindow();
v.Show();
Application.Current.MainWindow = v;
Application.Current.Windows.OfType<LauncherView>().First().Close();
}
}
}

View File

@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public class MainWindowViewModel : MainWindowModel
{
public MainWindowViewModel()
{
InitializeVariables();
InitializeCommands();
}
private void InitializeVariables()
{
Response = string.Empty;
}
private void InitializeCommands()
{
ViewProfile = new RelayCommand(ProfileView);
ViewFriends = new RelayCommand(FriendsView);
ViewMessages = new RelayCommand(MessagesView);
ViewMassMessage = new RelayCommand(MassMessageView);
Command = new RelayCommand(DoCommand);
}
private void DoCommand(object obj)
{
//Response = XboxConnection.GetClips();
TestFriendView v = new TestFriendView();
v.Show();
}
private void ProfileView(object obj)
{
ProfileViewerView v = new ProfileViewerView();
v.Show();
}
private void FriendsView(object obj)
{
FriendsListView v = new FriendsListView();
v.Show();
}
private void MessagesView(object obj)
{
MessengerView v = new MessengerView();
v.Show();
}
private void MassMessageView(object obj)
{
MassMessageView v = new MassMessageView();
v.Show();
}
}
}

View File

@@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public class MassMessageViewModel : MassMessageModel
{
public MassMessageViewModel()
{
InitializeVariables();
InitializeCommands();
}
private void InitializeVariables()
{
Friends = new List<Friend>(XboxConnection.GetFriends().OrderBy(b => b.Gamertag));
SelectedFriends = new List<Friend>();
Message = string.Empty;
IndividualMessages = true;
}
private void InitializeCommands()
{
AddSelected = new RelayCommand(SelectedAdd);
AddAll = new RelayCommand(AllAdd);
RemoveSelected = new RelayCommand(SelectedRemove);
RemoveAll = new RelayCommand(AllRemove);
SendMessage = new RelayCommand(MessageSend);
}
private void MessageSend(object obj)
{
if (IndividualMessages)
{
foreach (Friend f in SelectedFriends)
{
XboxConnection.SendMessage(f.Gamertag, Message);
}
MessageBox.Show(string.Format("Message sent to {0} friends.", SelectedFriends.Count), "Success", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
else
{
throw new NotImplementedException();
}
}
private void SelectedAdd(object obj)
{
List<Friend> LeftTemp = new List<Friend>(Friends);
List<Friend> RightTemp = new List<Friend>(SelectedFriends);
RightTemp.Add(LeftTemp.ElementAt(FriendIndex));
LeftTemp.RemoveAt(FriendIndex);
Friends = LeftTemp;
SelectedFriends = RightTemp;
}
private void AllAdd(object obj)
{
List<Friend> RightTemp = new List<Friend>(SelectedFriends);
foreach (Friend f in Friends)
RightTemp.Add(f);
SelectedFriends = RightTemp;
Friends = new List<Friend>();
}
private void SelectedRemove(object obj)
{
List<Friend> LeftTemp = new List<Friend>(Friends);
List<Friend> RightTemp = new List<Friend>(SelectedFriends);
LeftTemp.Add(RightTemp.ElementAt(SelectedFriendIndex));
RightTemp.RemoveAt(SelectedFriendIndex);
Friends = LeftTemp;
SelectedFriends = RightTemp;
}
private void AllRemove(object obj)
{
List<Friend> LeftTemp = new List<Friend>(Friends);
foreach (Friend f in SelectedFriends)
LeftTemp.Add(f);
SelectedFriends = new List<Friend>();
Friends = LeftTemp;
}
}
}

View File

@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public class MessengerViewModel : MessengerModel
{
public MessengerViewModel()
{
InitializeVariables();
InitializeCommands();
}
private void InitializeVariables()
{
Conversations = new List<ConversationSummary>();
}
private void InitializeCommands()
{
RefreshList = new RelayCommand(ListRefresh);
ViewConversation = new RelayCommand(ConversationView);
SendReply = new RelayCommand(ReplySend);
}
private void ListRefresh(object obj)
{
Conversations = new List<ConversationSummary>(XboxConnection.GetConversations());
}
private void ConversationView(object obj)
{
ConversationView v = new ConversationView(Conversations.ElementAt(SelectedConversationIndex).SenderGamertag, Conversations.ElementAt(SelectedConversationIndex).SenderXUID.ToString());
v.Show();
}
private void ReplySend(object obj)
{
string MessageText = string.Empty;
MessageBoxResult res = InputBoxView.ShowDialog(string.Format("New message to {0}", Conversations.ElementAt(SelectedConversationIndex).SenderGamertag), "Message:", out MessageText, MessageBoxButton.OKCancel);
if (res == MessageBoxResult.OK)
XboxConnection.SendMessage(Conversations.ElementAt(SelectedConversationIndex).SenderGamertag, MessageText);
}
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
public class ProfileViewerViewModel : ProfileViewerModel
{
public ProfileViewerViewModel()
{
InitializeVariables();
InitializeCommands();
}
private void InitializeVariables()
{
Profile = null;
}
private void InitializeCommands()
{
}
public void LoadProfile(XboxProfile profile)
{
Profile = profile;
}
}
}

View File

@@ -0,0 +1,29 @@
<Window x:Class="Kalakoi.Xbox.App.ConversationView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Kalakoi.Xbox.App"
mc:Ignorable="d"
Title="{Binding Title, UpdateSourceTrigger=PropertyChanged}" Height="300" Width="300">
<Window.DataContext>
<local:ConversationViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Button Content="Refresh" Command="{Binding RefreshList, UpdateSourceTrigger=PropertyChanged}" Grid.Row="0" Margin="3" Padding="1"/>
<ListView ItemsSource="{Binding Conversation.Messages, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Margin="3">
<ListView.View>
<GridView>
<GridViewColumn Header="Folder" DisplayMemberBinding="{Binding MessageFolder}"/>
<GridViewColumn Header="Message" DisplayMemberBinding="{Binding Text}"/>
</GridView>
</ListView.View>
</ListView>
<Button Content="Send Reply" Command="{Binding SendReply, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Margin="3" Padding="1"/>
</Grid>
</Window>

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
/// <summary>
/// Interaction logic for ConversationView.xaml
/// </summary>
public partial class ConversationView : Window
{
public ConversationView()
{
InitializeComponent();
}
public ConversationView(string Gamertag, string xuid)
{
InitializeComponent();
(DataContext as ConversationViewModel).Gamertag = Gamertag;
(DataContext as ConversationViewModel).xuid = xuid;
(DataContext as ConversationViewModel).Conversation = XboxConnection.GetConversation(xuid);
}
}
}

View File

@@ -0,0 +1,46 @@
<Window x:Class="Kalakoi.Xbox.App.FriendsListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Kalakoi.Xbox.App"
mc:Ignorable="d"
Title="{Binding Title, UpdateSourceTrigger=PropertyChanged}" Height="500" Width="600">
<Window.DataContext>
<local:FriendsListViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Content="Refresh" Command="{Binding RefreshList, UpdateSourceTrigger=PropertyChanged}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="3" Padding="1"/>
<ListView ItemsSource="{Binding Friends, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding SelectedFriendIndex, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="3">
<ListView.View>
<GridView>
<GridViewColumn Header="Gamertag" DisplayMemberBinding="{Binding Gamertag}"/>
<GridViewColumn Header="State" DisplayMemberBinding="{Binding PresenceState}"/>
<GridViewColumn Header="Presence" DisplayMemberBinding="{Binding PresenceText}"/>
<GridViewColumn Header="Is Favorite" DisplayMemberBinding="{Binding Favorite}"/>
<GridViewColumn Header="Is Friend" DisplayMemberBinding="{Binding IsFriend}"/>
<GridViewColumn Header="Is Follower" DisplayMemberBinding="{Binding IsFollower}"/>
</GridView>
</ListView.View>
</ListView>
<Button Content="View Profile" Command="{Binding ViewProfile, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="0" Margin="3" Padding="1" IsEnabled="{Binding FriendSelected, UpdateSourceTrigger=PropertyChanged}"/>
<Button Content="View Friends" Command="{Binding ViewFriends, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="1" Margin="3" Padding="1" IsEnabled="{Binding FriendSelected, UpdateSourceTrigger=PropertyChanged}"/>
<Button Content="Unfavorite Selected" Command="{Binding UnfavoriteFriend, UpdateSourceTrigger=PropertyChanged}" Grid.Row="3" Grid.Column="0" Margin="3" Padding="1" IsEnabled="{Binding FriendSelected, UpdateSourceTrigger=PropertyChanged}"/>
<Button Content="Favorite Selected" Command="{Binding FavoriteFriend, UpdateSourceTrigger=PropertyChanged}" Grid.Row="3" Grid.Column="1" Margin="3" Padding="1" IsEnabled="{Binding FriendSelected, UpdateSourceTrigger=PropertyChanged}"/>
<Button Content="Remove Friend" Command="{Binding RemoveFriend, UpdateSourceTrigger=PropertyChanged}" Grid.Row="4" Grid.Column="0" Margin="3" Padding="1" IsEnabled="{Binding FriendSelected, UpdateSourceTrigger=PropertyChanged}"/>
<Button Content="Add Friend" Command="{Binding AddFriend, UpdateSourceTrigger=PropertyChanged}" Grid.Row="4" Grid.Column="1" Margin="3" Padding="1"/>
<Button Content="Send Message" Command="{Binding SendMessage, UpdateSourceTrigger=PropertyChanged}" Grid.Row="5" Grid.Column="1" Margin="3" Padding="1" IsEnabled="{Binding FriendSelected, UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</Window>

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
/// <summary>
/// Interaction logic for FriendsListView.xaml
/// </summary>
public partial class FriendsListView : Window
{
public FriendsListView()
{
InitializeComponent();
(DataContext as FriendsListViewModel).Gamertag = XboxConnection.GetProfile().Gamertag;
(DataContext as FriendsListViewModel).xuid = XboxConnection.GetProfile().ID.ToString();
(DataContext as FriendsListViewModel).Friends = new List<Friend>(XboxConnection.GetFriends());
}
public FriendsListView(string Gamertag, string xuid)
{
InitializeComponent();
(DataContext as FriendsListViewModel).Gamertag = Gamertag;
(DataContext as FriendsListViewModel).xuid = xuid;
(DataContext as FriendsListViewModel).Friends = new List<Friend>(XboxConnection.GetFriends(xuid));
}
}
}

View File

@@ -0,0 +1,30 @@
<Window x:Class="Kalakoi.Xbox.App.InputBoxView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Kalakoi.Xbox.App"
mc:Ignorable="d"
Title="{Binding Title, UpdateSourceTrigger=PropertyChanged}" d:DesignHeight="300" Width="500" SizeToContent="Height">
<Window.DataContext>
<local:InputBoxViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Prompt, UpdateSourceTrigger=PropertyChanged}" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Margin="3"/>
<TextBox Text="{Binding Input, UpdateSourceTrigger=PropertyChanged}" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="1" Margin="3"/>
<Button Content="Cancel" Command="{Binding Cancel, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding CancelVisible, UpdateSourceTrigger=PropertyChanged}" Grid.Column="0" Grid.Row="2" Margin="3" Padding="1"/>
<Button Content="Yes" Command="{Binding Yes, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding YesNoVisible, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Grid.Row="2" Margin="3" Padding="1"/>
<Button Content="No" Command="{Binding No, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding YesNoVisible, UpdateSourceTrigger=PropertyChanged}" Grid.Column="2" Grid.Row="2" Margin="3" Padding="1"/>
<Button Content="OK" Command="{Binding OK, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding OKVisible, UpdateSourceTrigger=PropertyChanged}" Grid.Column="2" Grid.Row="2" Margin="3" Padding="1"/>
</Grid>
</Window>

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Kalakoi.Xbox.App
{
/// <summary>
/// Interaction logic for InputBoxView.xaml
/// </summary>
public partial class InputBoxView : Window
{
public InputBoxView()
{
InitializeComponent();
}
public static MessageBoxResult ShowDialog(string Title, string Prompt, out string Input, MessageBoxButton Buttons = MessageBoxButton.OK)
{
InputBoxView v = new InputBoxView();
(v.DataContext as InputBoxViewModel).SetBox(Title, Prompt, Buttons);
v.ShowDialog();
Input = (v.DataContext as InputBoxViewModel).Input;
return (v.DataContext as InputBoxViewModel).Result;
}
}
}

View File

@@ -0,0 +1,22 @@
<Window x:Class="Kalakoi.Xbox.App.LauncherView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Kalakoi.Xbox.App"
mc:Ignorable="d"
Title="LauncherView" Height="300" Width="300" SizeToContent="Height">
<Window.DataContext>
<local:LauncherViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="API Key:" Grid.Row="0" Margin="3"/>
<TextBox Text="{Binding Key, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Margin="3"/>
<Button Content="Launch" Command="{Binding Launch, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Margin="3" Padding="1"/>
</Grid>
</Window>

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Kalakoi.Xbox.App
{
/// <summary>
/// Interaction logic for LauncherView.xaml
/// </summary>
public partial class LauncherView : Window
{
public LauncherView()
{
InitializeComponent();
}
}
}

30
src/Views/MainWindow.xaml Normal file
View File

@@ -0,0 +1,30 @@
<Window x:Class="Kalakoi.Xbox.App.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Kalakoi.Xbox.App"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Window.DataContext>
<local:MainWindowViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding Response, UpdateSourceTrigger=PropertyChanged}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="3"/>
<Button Content="Test" Command="{Binding Command, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="0" Margin="3" Padding="1"/>
<Button Content="Profile" Command="{Binding ViewProfile, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="1" Margin="3" Padding="1"/>
<Button Content="Friends" Command="{Binding ViewFriends, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="0" Margin="3" Padding="1"/>
<Button Content="Messages" Command="{Binding ViewMessages, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="1" Margin="3" Padding="1"/>
<Button Content="Mass Message" Command="{Binding ViewMassMessage, UpdateSourceTrigger=PropertyChanged}" Grid.Row="3" Grid.Column="1" Margin="3" Padding="1"/>
</Grid>
</Window>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Kalakoi.Xbox.App
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,50 @@
<Window x:Class="Kalakoi.Xbox.App.MassMessageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Kalakoi.Xbox.App"
mc:Ignorable="d"
Title="Mass Messager" Height="300" Width="300">
<Window.DataContext>
<local:MassMessageViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ListView ItemsSource="{Binding Friends, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding FriendIndex, UpdateSourceTrigger=PropertyChanged}" Grid.Row="0" Grid.RowSpan="4" Grid.Column="0" Margin="3" SelectionMode="Single">
<ListView.View>
<GridView>
<GridViewColumn Header="Gamertag" DisplayMemberBinding="{Binding Gamertag}"/>
</GridView>
</ListView.View>
</ListView>
<ListView ItemsSource="{Binding SelectedFriends, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding SelectedFriendIndex, UpdateSourceTrigger=PropertyChanged}" Grid.Row="0" Grid.RowSpan="4" Grid.Column="3" Margin="3" SelectionMode="Single">
<ListView.View>
<GridView>
<GridViewColumn Header="Gamertag" DisplayMemberBinding="{Binding Gamertag}"/>
</GridView>
</ListView.View>
</ListView>
<Button Content="&lt;-" Command="{Binding RemoveSelected, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="1" Margin="3" Padding="1"/>
<Button Content="-&gt;" Command="{Binding AddSelected, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="2" Margin="3" Padding="1"/>
<Button Content="&lt;&lt;" Command="{Binding RemoveAll, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="1" Margin="3" Padding="1"/>
<Button Content="&gt;&gt;" Command="{Binding AddAll, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="2" Margin="3" Padding="1"/>
<TextBox Text="{Binding Message, UpdateSourceTrigger=PropertyChanged}" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4" Margin="3" SpellCheck.IsEnabled="True"/>
<CheckBox IsEnabled="False" Content="Send Individual Messages" IsChecked="{Binding IndividualMessages, UpdateSourceTrigger=PropertyChanged}" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4" Margin="3"/>
<Button Content="Send Mass Message" Command="{Binding SendMessage, UpdateSourceTrigger=PropertyChanged}" Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" Margin="3" Padding="1"/>
</Grid>
</Window>

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Kalakoi.Xbox.App
{
/// <summary>
/// Interaction logic for MassMessageView.xaml
/// </summary>
public partial class MassMessageView : Window
{
public MassMessageView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,37 @@
<Window x:Class="Kalakoi.Xbox.App.MessengerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Kalakoi.Xbox.App"
mc:Ignorable="d"
Title="Messages" Height="300" Width="300">
<Window.DataContext>
<local:MessengerViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Content="Refresh" Command="{Binding RefreshList, UpdateSourceTrigger=PropertyChanged}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="3" Padding="1"/>
<ListView ItemsSource="{Binding Conversations, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding SelectedConversationIndex, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="3">
<ListView.View>
<GridView>
<GridViewColumn Header="Gamertag" DisplayMemberBinding="{Binding SenderGamertag}"/>
<GridViewColumn Header="Sent Time" DisplayMemberBinding="{Binding LastSent}"/>
<GridViewColumn Header="Message Count" DisplayMemberBinding="{Binding MessageCount}"/>
<GridViewColumn Header="Unread Count" DisplayMemberBinding="{Binding UnreadMessageCount}"/>
<GridViewColumn Header="Last Message" DisplayMemberBinding="{Binding LastMessage.Text}"/>
</GridView>
</ListView.View>
</ListView>
<Button Content="View Conversation" Command="{Binding ViewConversation, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding ConversationSelected, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="0" Margin="3" Padding="1"/>
<Button Content="Send Reply" Command="{Binding SendReply, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding ConversationSelected, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="1" Margin="3" Padding="1"/>
</Grid>
</Window>

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
/// <summary>
/// Interaction logic for MessengerView.xaml
/// </summary>
public partial class MessengerView : Window
{
public MessengerView()
{
InitializeComponent();
(DataContext as MessengerViewModel).Conversations = new List<ConversationSummary>(XboxConnection.GetConversations());
}
}
}

View File

@@ -0,0 +1,39 @@
<Window x:Class="Kalakoi.Xbox.App.ProfileViewerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Kalakoi.Xbox.App"
mc:Ignorable="d"
Title="{Binding Gamertag, UpdateSourceTrigger=PropertyChanged}" Foreground="White" SizeToContent="WidthAndHeight" Background="{Binding Primary, UpdateSourceTrigger=PropertyChanged}">
<Window.DataContext>
<local:ProfileViewerViewModel/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Ellipse Height="200" Width="200" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" HorizontalAlignment="Center" Margin="3">
<Ellipse.Fill>
<ImageBrush ImageSource="{Binding ProfilePicture, UpdateSourceTrigger=PropertyChanged}" Stretch="UniformToFill"/>
</Ellipse.Fill>
</Ellipse>
<TextBlock Text="{Binding Gamerscore, UpdateSourceTrigger=PropertyChanged}" Grid.Column="0" Grid.Row="1" Margin="3"/>
<TextBlock Text="{Binding Gamertag, UpdateSourceTrigger=PropertyChanged}" Grid.Column="0" Grid.Row="2" Margin="3"/>
<TextBlock Text="{Binding RealName, UpdateSourceTrigger=PropertyChanged}" Grid.Column="0" Grid.Row="3" Margin="3"/>
<TextBlock Text="Bio:" Grid.Column="0" Grid.Row="4" Margin="3"/>
<TextBlock Text="Location:" Grid.Column="1" Grid.Row="4" Margin="3"/>
<TextBlock Text="{Binding Bio, UpdateSourceTrigger=PropertyChanged}" Grid.Column="0" Grid.Row="5" Margin="3"/>
<TextBlock Text="{Binding Location, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Grid.Row="5" Margin="3"/>
</Grid>
</Window>

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Kalakoi.Xbox.OpenXBL;
namespace Kalakoi.Xbox.App
{
/// <summary>
/// Interaction logic for ProfileViewerView.xaml
/// </summary>
public partial class ProfileViewerView : Window
{
public ProfileViewerView()
{
InitializeComponent();
(DataContext as ProfileViewerViewModel).Profile = XboxConnection.GetProfile();
}
public ProfileViewerView(XboxProfile Profile)
{
InitializeComponent();
(DataContext as ProfileViewerViewModel).Profile = Profile;
}
public ProfileViewerView(string Gamertag)
{
InitializeComponent();
(DataContext as ProfileViewerViewModel).Profile = XboxConnection.GetProfile(Gamertag);
}
}
}