Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release/0.10.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSylence committed Nov 11, 2017
2 parents 18c9269 + 31831e2 commit 64039f3
Show file tree
Hide file tree
Showing 259 changed files with 3,314 additions and 4,466 deletions.
2 changes: 1 addition & 1 deletion Twice/App.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
Expand Down
58 changes: 38 additions & 20 deletions Twice/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,46 @@
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />

<!-- Material Design -->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.BlueGrey.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Blue.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.BlueGrey.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Blue.xaml" />

<!-- Material Design: MahApps Compatibility -->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Flyout.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Fonts.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Flyout.xaml" />

<!-- Material Deisng Items -->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.CheckBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ListBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RadioButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ComboBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Font.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.DatePicker.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TimePicker.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBox.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.CheckBox.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ListBox.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RadioButton.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ComboBox.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Font.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.DatePicker.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TimePicker.xaml" />

<ResourceDictionary Source="Resources/Converters.xaml" />
<ResourceDictionary Source="Resources/DataTemplates.xaml" />
Expand Down Expand Up @@ -86,8 +104,8 @@
</Style>

<Style TargetType="{x:Type TabControl}">
<Setter Property="Background" Value="{StaticResource MaterialDesignPaper}"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Background" Value="{StaticResource MaterialDesignPaper}" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>

<viewModels:ViewModelLocator x:Key="Locator" />
Expand Down
4 changes: 2 additions & 2 deletions Twice/AsyncErrorHandler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Anotar.NLog;
using System;
using System;
using System.Diagnostics.CodeAnalysis;
using Anotar.NLog;

// ReSharper disable UnusedMember.Global

Expand Down
4 changes: 2 additions & 2 deletions Twice/Attributes/IconAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MaterialDesignThemes.Wpf;
using System;
using System;
using System.Diagnostics.CodeAnalysis;
using MaterialDesignThemes.Wpf;

namespace Twice.Attributes
{
Expand Down
50 changes: 25 additions & 25 deletions Twice/Behaviors/AutoComplete.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MaterialDesignThemes.Wpf;
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
Expand All @@ -10,11 +9,12 @@
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Media;
using MaterialDesignThemes.Wpf;

namespace Twice.Behaviors
{
/// <summary>
/// Behavior that can be attached to a TextBox to allow autocomplete functionality.
/// Behavior that can be attached to a TextBox to allow autocomplete functionality.
/// </summary>
[ExcludeFromCodeCoverage]
internal class AutoComplete : BehaviorBase<TextBox>
Expand All @@ -37,13 +37,6 @@ public AutoComplete()
AutoCompletePopup.Closed += AutoCompletePopup_Closed;
}

private enum SourceMode
{
None,
Hashtags,
Users
}

protected override void OnAttached()
{
AssociatedObject.PreviewTextInput += AssociatedObject_TextInput;
Expand Down Expand Up @@ -202,17 +195,12 @@ private void InsertText()
AssociatedObject.CaretIndex = currentCaret + insertText.Length;
}

public IEnumerable<string> Hashtags
{
get { return (IEnumerable<string>)GetValue( ItemsSourceProperty ); }
set { SetValue( ItemsSourceProperty, value ); }
}
public static readonly DependencyProperty ItemsSourceProperty =
DependencyProperty.Register( "Hashtags", typeof( IEnumerable<string> ), typeof( AutoComplete ),
new PropertyMetadata( new string[] { } ) );

public IEnumerable<string> Users
{
get { return (IEnumerable<string>)GetValue( UsersProperty ); }
set { SetValue( UsersProperty, value ); }
}
public static readonly DependencyProperty UsersProperty =
DependencyProperty.Register( "Users", typeof( IEnumerable<string> ), typeof( AutoComplete ), new PropertyMetadata( new string[] { } ) );

private IEnumerable<string> FilteredHashtags
{
Expand Down Expand Up @@ -246,16 +234,28 @@ private IEnumerable<string> FilteredUsers
}
}

public static readonly DependencyProperty ItemsSourceProperty =
DependencyProperty.Register( "Hashtags", typeof( IEnumerable<string> ), typeof( AutoComplete ),
new PropertyMetadata( new string[] { } ) );
public IEnumerable<string> Hashtags
{
get => (IEnumerable<string>)GetValue( ItemsSourceProperty );
set => SetValue( ItemsSourceProperty, value );
}

public static readonly DependencyProperty UsersProperty =
DependencyProperty.Register( "Users", typeof( IEnumerable<string> ), typeof( AutoComplete ), new PropertyMetadata( new string[] { } ) );
public IEnumerable<string> Users
{
get => (IEnumerable<string>)GetValue( UsersProperty );
set => SetValue( UsersProperty, value );
}

private readonly ListView AutoCompleteBox;
private readonly Popup AutoCompletePopup;
private string FilterText;
private SourceMode Mode = SourceMode.None;

private enum SourceMode
{
None,
Hashtags,
Users
}
}
}
2 changes: 1 addition & 1 deletion Twice/Behaviors/BehaviorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Twice.Behaviors
{
/// <summary>
/// Base class for a behavior that handles proper unloading.
/// Base class for a behavior that handles proper unloading.
/// </summary>
/// <typeparam name="T"></typeparam>
public abstract class BehaviorBase<T> : Behavior<T> where T : FrameworkElement
Expand Down
28 changes: 14 additions & 14 deletions Twice/Behaviors/CallbackOnLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Twice.Behaviors
{
/// <summary>
/// Offers the ability to execute async code when a FrameworkElement has been loaded.
/// Offers the ability to execute async code when a FrameworkElement has been loaded.
/// </summary>
[ExcludeFromCodeCoverage]
internal class CallbackOnLoad : BehaviorBase<FrameworkElement>
Expand All @@ -23,29 +23,29 @@ protected override void OnAttached()
};
}

public static readonly DependencyProperty CallbackProperty = DependencyProperty.Register( "Callback",
typeof( ILoadCallback ), typeof( CallbackOnLoad ),
new PropertyMetadata( null ) );

public static readonly DependencyProperty DataProperty =
DependencyProperty.Register( "Data", typeof( object ), typeof( CallbackOnLoad ), new PropertyMetadata( null ) );

/// <summary>
/// Handler to call when the element was loaded
/// Handler to call when the element was loaded
/// </summary>
public ILoadCallback Callback
{
get { return (ILoadCallback)GetValue( CallbackProperty ); }
set { SetValue( CallbackProperty, value ); }
get => (ILoadCallback)GetValue( CallbackProperty );
set => SetValue( CallbackProperty, value );
}

/// <summary>
/// Data to pass to <see cref="ILoadCallback.OnLoad(object)" />
/// Data to pass to <see cref="ILoadCallback.OnLoad(object)" />
/// </summary>
public object Data
{
get { return GetValue( DataProperty ); }
set { SetValue( DataProperty, value ); }
get => GetValue( DataProperty );
set => SetValue( DataProperty, value );
}

public static readonly DependencyProperty CallbackProperty = DependencyProperty.Register( "Callback",
typeof( ILoadCallback ), typeof( CallbackOnLoad ),
new PropertyMetadata( null ) );

public static readonly DependencyProperty DataProperty =
DependencyProperty.Register( "Data", typeof( object ), typeof( CallbackOnLoad ), new PropertyMetadata( null ) );
}
}
2 changes: 1 addition & 1 deletion Twice/Behaviors/CenterAfterRender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Twice.Behaviors
{
class CenterAfterRender : BehaviorBase<Window>
internal class CenterAfterRender : BehaviorBase<Window>
{
protected override void OnAttached()
{
Expand Down
26 changes: 13 additions & 13 deletions Twice/Behaviors/ClickHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Twice.Behaviors
{
/// <summary>
/// Executes a command when a FrameworkElement has been clicked.
/// Executes a command when a FrameworkElement has been clicked.
/// </summary>
/// <remarks> Essentially this is a nicer way than using EventToCommand for the click command </remarks>
[ExcludeFromCodeCoverage]
Expand All @@ -30,28 +30,28 @@ private void AssociatedObject_MouseDown( object sender, MouseButtonEventArgs e )
}
}

public static readonly DependencyProperty CommandParameterProperty =
DependencyProperty.Register( "CommandParameter", typeof( object ), typeof( ClickHandler ), new PropertyMetadata( null ) );

public static readonly DependencyProperty CommandProperty =
DependencyProperty.Register( "Command", typeof( ICommand ), typeof( ClickHandler ), new PropertyMetadata( null ) );

/// <summary>
/// The command to execute
/// The command to execute
/// </summary>
public ICommand Command
{
get { return (ICommand)GetValue( CommandProperty ); }
set { SetValue( CommandProperty, value ); }
get => (ICommand)GetValue( CommandProperty );
set => SetValue( CommandProperty, value );
}

/// <summary>
/// Parameter that will be passed to the command
/// Parameter that will be passed to the command
/// </summary>
public object CommandParameter
{
get { return GetValue( CommandParameterProperty ); }
set { SetValue( CommandParameterProperty, value ); }
get => GetValue( CommandParameterProperty );
set => SetValue( CommandParameterProperty, value );
}

public static readonly DependencyProperty CommandParameterProperty =
DependencyProperty.Register( "CommandParameter", typeof( object ), typeof( ClickHandler ), new PropertyMetadata( null ) );

public static readonly DependencyProperty CommandProperty =
DependencyProperty.Register( "Command", typeof( ICommand ), typeof( ClickHandler ), new PropertyMetadata( null ) );
}
}
4 changes: 2 additions & 2 deletions Twice/Behaviors/CloseableFlyout.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MahApps.Metro.Controls;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.CodeAnalysis;
using System.Windows;
using MahApps.Metro.Controls;
using Twice.ViewModels;

namespace Twice.Behaviors
Expand Down
2 changes: 1 addition & 1 deletion Twice/Behaviors/CloseableView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Twice.Behaviors
{
/// <summary>
/// Allows a window to be closed from the window's DataContext
/// Allows a window to be closed from the window's DataContext
/// </summary>
[ExcludeFromCodeCoverage]
internal class CloseableView : BehaviorBase<Window>
Expand Down
12 changes: 6 additions & 6 deletions Twice/Behaviors/ColumnHeaderHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ private void AssociatedObject_MouseLeftButtonUp( object sender, MouseButtonEvent
ActionDispatcher?.OnHeaderClicked();
}

public static readonly DependencyProperty ActionDispatcherProperty =
DependencyProperty.Register( "ActionDispatcher", typeof( IColumnActionDispatcher ), typeof( ColumnHeaderHandler ),
new PropertyMetadata( null ) );

public IColumnActionDispatcher ActionDispatcher
{
get { return (IColumnActionDispatcher)GetValue( ActionDispatcherProperty ); }
set { SetValue( ActionDispatcherProperty, value ); }
get => (IColumnActionDispatcher)GetValue( ActionDispatcherProperty );
set => SetValue( ActionDispatcherProperty, value );
}

public static readonly DependencyProperty ActionDispatcherProperty =
DependencyProperty.Register( "ActionDispatcher", typeof( IColumnActionDispatcher ), typeof( ColumnHeaderHandler ),
new PropertyMetadata( null ) );
}
}
Loading

0 comments on commit 64039f3

Please sign in to comment.