Skip to content

Instantly share code, notes, and snippets.

View clausjoergensen's full-sized avatar

Claus Jørgensen clausjoergensen

View GitHub Profile
<Grid
Width="48"
Height="48"
Margin="0,-75,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
assets:DependencyObjectExtension.NavigateTo="/Views/SearchStationsPage.xaml"
Background="Transparent">
<Ellipse
Width="48"
var items = list.Descendants("div")
.FirstOrDefault(x => x.Id == "FlightInfo_FlightInfoUpdatePanel")
.Element("table")
.Element("tbody")
.Elements("tr")
.Select(tr => tr.InnerHtml)
var text = string.Join(items, Environment.NewLine);
using System.ComponentModel;
using System.Windows.Forms;
namespace WindowsFormsApplication
{
public class MainForm : Form
{
private IContainer components;
private NotifyIcon notifyIcon;
@clausjoergensen
clausjoergensen / ScheduledAgent.cs
Created September 27, 2011 05:06
Gets the latest tweet, and draws it on a live tile
GetLatestTweet("Windcape")
.ContinueWith(task =>
{
var tcs = new TaskCompletionSource<bool>(
TaskCreationOptions.AttachedToParent);
if (task.IsCompleted)
{
if (task.Result.Count > 0)
{
public WatchItem CurrentWatchItem
{
get;
set;
}
private void OnCurrentWatchItemChanged()
{
eventAggregator.GetEvent<TickerSymbolSelectedEvent>()
.Publish(CurrentWatchItem.TickerSymbol);
var document = XDocument.Load(File.OpenRead(@"myfile.xml"));
var entities = document.Element("ImportExportXml").Element("Entities").Elements("Entity");
var result =
entities.Elements("Entity")
.SelectMany(
e => e.Element("EntityInfo").Element("attributes").Elements("attribute"))
.Distinct();
result.Dump();
public ImageSource ImageUri
{
get
{
BitmapImage image = new BitmapImage();
try
{
image.BeginInit();
image.CacheOption = BitmapCacheOption.OnLoad;
CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(
DateTime.Now,
CultureInfo.CurrentCulture.DateTimeFormat.CalendarWeekRule,
CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek
);
<ListBox ItemsSource="{Binding Tiles}" SelectionChanged="ListBox_SelectionChanged">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<toolkit:HubTile Title="{Binding Author}"
Margin="3"
// remove
//private void RecipeListBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
//{
// ViewModel.SelectedRecipe = (Recipe)RecipeListBox.SelectedItem;
//}
// replace with:
private void HubTile_Tap(object sender, System.Windows.Input.GestureEventArgs e)