Skip to content

Instantly share code, notes, and snippets.

View tmyt's full-sized avatar
🏠
Working from home

Yutaka TSUMORI tmyt

🏠
Working from home
View GitHub Profile
@tmyt
tmyt / gist:4216533
Created December 5, 2012 15:26
XamlからCharmつくるやつ。Flyoutの中身をUserControlで作れるようになりました
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
using Windows.UI;
using Windows.UI.ApplicationSettings;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
@tmyt
tmyt / MainPage.xaml
Created October 25, 2012 04:52
AttachedPropertyに設定される値がFrameworkElementを継承していない場合にUri型に値を設定できない?
<Page
x:Class="App1.MainPage"
IsTabStop="false"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
@tmyt
tmyt / gist:3939343
Created October 23, 2012 15:15
OITEC14
Windows8とWindows Phone共に採用しているのはC#/XAML技術です。
ベースとなる技術が同じであれば、Windows PhoneのアプリはWindows8でそのまま動かすことが出来るのでしょうか。
先に結論を述べるならばほぼ確実に不可能です。なぜなら、C#という言語機能、XAMLというUIテクノロジにこそ互換性はあれど、それぞれのプラットフォームで利用出来るAPIセットが異なるからです。
しかしながら、人間1度作ったものを作り直したくないもの。今回はどうにかしてマウスだけでアプリを移植してみたいと思います。
string convert(byte[] bytes)
{
var s = transcode(bytes);
var re = new Regex("&#[xX]([a-fA-F0-9]);");
return re.Replace(s, m=>{
var hex = m.Groups[1].Value;
return ((char)Convert.ToInt16(hex, 16)).ToString();
});
}
@tmyt
tmyt / gist:3405248
Created August 20, 2012 15:42
ビヘイビアすらめんどくさいものぐささんむけ
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
@tmyt
tmyt / gist:3405206
Created August 20, 2012 15:37
SettingsCharmの項目をXAMLから追加したい
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
using Windows.UI.ApplicationSettings;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Markup;
namespace Extras.Charms
{
@tmyt
tmyt / gist:3325351
Created August 11, 2012 15:48 — forked from anonymous/gist:3325279
async/awaitでOAuthしてみるあれ
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using MFToolkit.Cryptography;
@tmyt
tmyt / gist:2933438
Created June 14, 2012 22:38
PopupMenuをXAMLから使いたい
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Windows.Foundation;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@tmyt
tmyt / gist:1992494
Created March 7, 2012 10:52
Metro Style AppでWindowsPhone7.1のNavigationServiceを使ってみたかった
/**
* Windows Phone 7.1 の System.Windows.Navigation.NavigationService の互換品みたいなもの。
* Metro Style AppでNavigationServiceを使ったコードをコピペできるようになるかも?
* Author: tmyt
*/
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using Windows.ApplicationModel.Resources.Core;
// License: NYSL
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;