Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Management;
using System.Net;
using System.Net.Sockets;
using System.Net.Http.Headers;
using System.Text;
@McTopaz
McTopaz / App.xaml
Last active May 27, 2021 13:04
Custom backgrounds for light and dark themes
<Application x:Class="MaterialDesignTest.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MaterialDesignTest"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@McTopaz
McTopaz / MainWindow.xaml
Created October 8, 2019 09:36
DataGridView with DataGridTemplateColumns - Cannot create new rows
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.DataContext>
@McTopaz
McTopaz / Controller
Created October 3, 2019 10:29
Struktur av MVVM
namespace My_WPF_Project
{
public class Controller
{
vmHeader Vm { get; set; }
public Controller(vmHeader vm)
{
Vm = vm;
@McTopaz
McTopaz / FodyWeaver.xml
Created March 15, 2018 12:11
Bind the selected string in a TextBlock inside a ListView inside a cell of a DataGrid to a ViewModel
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
<PropertyChanged />
</Weavers>