This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is an example of the usage | |
private static INavigationService Navigation => SimpleIoc.Default.GetInstance<INavigationService>(); | |
public App(IContainer container) | |
{ | |
container.Create(); | |
SetNavigationHomePage(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using System.Windows.Input; | |
using Windows.ApplicationModel.DataTransfer; | |
using Windows.Storage; | |
using Windows.UI.Xaml; | |
using ScottIsAFool.Model; | |
using Microsoft.Xaml.Interactivity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ScottIsAFool.Windows.Core.ViewModel | |
{ | |
public interface IListType | |
{ | |
ListType ListType { get; } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class UriExtensions | |
{ | |
/// <summary> | |
/// Gets a collection of query string values. | |
/// </summary> | |
/// <param name="uri">The current uri.</param> | |
/// <returns>A collection that contains the query string values.</returns> | |
public static IDictionary<string, string> QueryString(this Uri uri) | |
{ | |
var uriString = uri.IsAbsoluteUri ? uri.AbsoluteUri : uri.OriginalString; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; | |
using Windows.UI.Xaml.Media; | |
using MyApp.Extensions; | |
namespace MyApp.Controls | |
{ | |
public class CustomCommandBar : CommandBar | |
{ | |
public CustomCommandBar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Style x:Key="EmptyButtonStyle" | |
TargetType="ButtonBase"> | |
<Setter Property="Background" | |
Value="Transparent" /> | |
<Setter Property="Padding" | |
Value="0" /> | |
<Setter Property="HorizontalContentAlignment" | |
Value="Stretch" /> | |
<Setter Property="HorizontalAlignment" | |
Value="Stretch" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Item Title="built by" | |
Type="xaml"> | |
<scott:FerretLabs xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:scott="clr-namespace:ScottIsAFool.WindowsPhone;assembly=ScottIsAFool.WindowsPhone" | |
HorizontalAlignment="Stretch" | |
VerticalAlignment="Top"/> | |
</Item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async Task ToImage(UIElement element, string filename, double height, double width) | |
{ | |
element.UpdateLayout(); | |
element.Measure(new Size(width, height)); | |
element.UpdateLayout(); | |
element.Arrange(new Rect { Height = height, Width = width }); | |
var bitmap = new WriteableBitmap((int)width, (int)height); | |
bitmap.Render(element, null); | |
bitmap.Invalidate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class AttributeExtensions | |
{ | |
public static string GetDescription(this object en) | |
{ | |
var type = en.GetType(); | |
var memInfo = type.GetTypeInfo().DeclaredMembers; | |
var attrs = memInfo.FirstOrDefault(x => x.Name == en.ToString()); | |
if (attrs != null) | |
{ |
NewerOlder