Skip to content

Instantly share code, notes, and snippets.

View MartinZikmund's full-sized avatar
⌨️
Coding

Martin Zikmund MartinZikmund

⌨️
Coding
View GitHub Profile
public class GameState
{
public GameState(int size)
{
Cells = new CellState[size, size];
Size = size;
}
public int Size { get; }
public enum CellState
{
Dead,
Alive
}
<Grid>
<TextBlock Text="This is a title" Panel.ZIndex="10" />
<Image Source="/Assets/Background.jpg" Stretch="UniformToFill" />
</Grid>
<Grid>
<TextBlock Text="This is a title" Style="{ThemeResource TitleTextBlockStyle}" Canvas.ZIndex="10" />
<Image Source="/Assets/Background.jpg" Stretch="UniformToFill" />
</Grid>
<Grid>
<Image Source="/Assets/Background.jpg" Stretch="UniformToFill" />
<TextBlock Text="This is a title" Style="{ThemeResource TitleTextBlockStyle}" />
</Grid>
<Grid>
<TextBlock Text="This is a title" Style="{ThemeResource TitleTextBlockStyle}" />
<Image Source="/Assets/Background.jpg" Stretch="UniformToFill" />
</Grid>
var view = item.Content;
if (view.Contains(StandardDataFormats.Bitmap))
{
var bitmapReference = await view.GetBitmapAsync();
if (bitmapReference != null)
{
var bitmap = new BitmapImage();
await bitmap.SetSourceAsync(await bitmapReference.OpenReadAsync());
viewer.ContentGrid.Children.Add(new Image() { Width = 300, Height = 300, Stretch = Stretch.None, Source = bitmap });
}
var historyItems = await Clipboard.GetHistoryItemsAsync();
if (historyItems.Status == ClipboardHistoryItemsResultStatus.Success)
{
foreach (var item in historyItems.Items)
{
// ...
}
}
Clipboard.HistoryEnabledChanged += (S,e) =>
{
if (Clipboard.IsHistoryEnabled())
{
// Retrieve history items
}
}
await Launcher.LaunchUriAsync("ms-settings:clipboard");