This file contains hidden or 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
| <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" |
This file contains hidden or 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
| 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); |
This file contains hidden or 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.ComponentModel; | |
| using System.Windows.Forms; | |
| namespace WindowsFormsApplication | |
| { | |
| public class MainForm : Form | |
| { | |
| private IContainer components; | |
| private NotifyIcon notifyIcon; |
This file contains hidden or 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
| GetLatestTweet("Windcape") | |
| .ContinueWith(task => | |
| { | |
| var tcs = new TaskCompletionSource<bool>( | |
| TaskCreationOptions.AttachedToParent); | |
| if (task.IsCompleted) | |
| { | |
| if (task.Result.Count > 0) | |
| { |
This file contains hidden or 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 WatchItem CurrentWatchItem | |
| { | |
| get; | |
| set; | |
| } | |
| private void OnCurrentWatchItemChanged() | |
| { | |
| eventAggregator.GetEvent<TickerSymbolSelectedEvent>() | |
| .Publish(CurrentWatchItem.TickerSymbol); |
This file contains hidden or 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
| 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(); |
This file contains hidden or 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 ImageSource ImageUri | |
| { | |
| get | |
| { | |
| BitmapImage image = new BitmapImage(); | |
| try | |
| { | |
| image.BeginInit(); | |
| image.CacheOption = BitmapCacheOption.OnLoad; |
This file contains hidden or 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
| CultureInfo.CurrentCulture.Calendar.GetWeekOfYear( | |
| DateTime.Now, | |
| CultureInfo.CurrentCulture.DateTimeFormat.CalendarWeekRule, | |
| CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek | |
| ); |
This file contains hidden or 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
| <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" |
This file contains hidden or 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
| // 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) |