Skip to content

Instantly share code, notes, and snippets.

View runceel's full-sized avatar

Kazuki Ota runceel

View GitHub Profile
@runceel
runceel / gist:9508013
Created March 12, 2014 14:26
こんな
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Web.Syndication;
namespace App1
{
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App11"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core" xmlns:Media="using:Microsoft.Xaml.Interactions.Media"
x:Class="App11.MainPage"
mc:Ignorable="d">
<Page.Resources>
// こんなんどっかで用意して
interface IDloalogService
{
Task<bool> Confirm(string content, string title);
}
class DialogService : IDialogService
{
private static IDialogService instance;
public static IDialogService Instance
using Codeplex.Reactive;
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Reactive.Linq;
using System.Runtime.CompilerServices;
namespace CSharp_vNext_ConsoleApplication2
{
class Program
using Codeplex.Reactive.Extensions;
using Codeplex.Reactive.Notifiers;
using System;
using System.Diagnostics;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Reactive.Subjects;
namespace ConsoleApplication6
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Codeplex.Reactive.Binding;
using Codeplex.Reactive;
using Codeplex.Reactive.Extensions;
// ネットに接続されてる間はtrueとか
var connected = new BooleanNotifier();
// ダウンロード中はtrueとか
var downloading = new BooleanNotfier();
var command = new[]
{
connected,
downloading.Select(x => !x)
}
@runceel
runceel / a
Last active August 29, 2015 14:15
// これなら作れるかも
this.Name = model
.ObserveProperty(x => x.Name)
.ToReactiveProperty()
.SetValidateNotifyError(x =>
string.IsNullOrWhiteSpace(x) ? "Name is required" : null)
.Valid(x => model.Name = x);
using Codeplex.Reactive;
using System;
using System.Reactive;
using System.Reactive.Subjects;
using System.Windows;
using System.Windows.Interactivity;
using System.Reactive.Linq;
namespace WpfApplication1
{
IsAnyToBeErased = Profiles
.CollectionChangedAsObservable()
.SelectMany(_ => Observable.Defer<bool>(() =>
{
return Profiles.Select(x => x.ObserveProperty(y => y.IsToBeErased)).Merge();
}))
.Select(_ => Profiles.Any(x => x.IsToBeErased))
.ToReactiveProperty();