Jonatan Gezelius преди 2 години
ревизия
b77d9a0aa5

+ 195 - 0
.gitignore

@@ -0,0 +1,195 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Visual Studio 2015 cache/options directory
+.vs/
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+build/
+bld/
+[Bb]in/
+[Oo]bj/
+
+# Roslyn cache directories
+*.ide/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+#NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+*.cachefile
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding addin-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+## TODO: Comment the next line if you want to checkin your
+## web deploy settings but do note that will include unencrypted
+## passwords
+*.pubxml
+
+# NuGet Packages Directory
+packages/*
+## TODO: If the tool you use requires repositories.config
+## uncomment the next line
+#!packages/repositories.config
+
+# Enable "build/" folder in the NuGet Packages folder since
+# NuGet packages use it for MSBuild targets.
+# This line needs to be after the ignore of the build folder
+# (and the packages folder if the line above has been uncommented)
+!packages/build/
+
+# Windows Azure Build Output
+csx/
+*.build.csdef
+
+# Windows Store app package directory
+AppPackages/
+
+# Others
+sql/
+*.Cache
+ClientBin/
+[Ss]tyle[Cc]op.*
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.pfx
+*.publishsettings
+node_modules/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+git_stats/*
+
+*.ncrunchproject
+StyleCop.Cache
+bin
+obj

+ 14 - 0
App.xaml

@@ -0,0 +1,14 @@
+<Application x:Class="friaLabbar.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:friaLabbar">
+    <Application.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary>
+                    <local:SkoRem x:Key="bootstrapper" />
+                </ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </Application.Resources>
+</Application>

+ 17 - 0
App.xaml.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace friaLabbar
+{
+    /// <summary>
+    /// Interaction logic for App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}

+ 10 - 0
AssemblyInfo.cs

@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+                                     //(used if a resource is not found in the page,
+                                     // or application resource dictionaries)
+    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+                                              //(used if a resource is not found in the page,
+                                              // app, or any theme specific resource dictionaries)
+)]

+ 31 - 0
MainWindow.xaml

@@ -0,0 +1,31 @@
+<Window x:Class="friaLabbar.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:friaLabbar"
+        mc:Ignorable="d"
+        Title="This is the text in the title" Height="450" Width="800">
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="20" />
+            <ColumnDefinition Width="auto" />
+            <ColumnDefinition Width="auto" />
+            <ColumnDefinition Width="auto" />
+            <ColumnDefinition Width="auto" />
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="20" />
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="20" />
+            <RowDefinition Height="auto" />
+            <RowDefinition Height="auto" />
+            <RowDefinition Height="auto" />
+            <RowDefinition Height="auto" />
+            <RowDefinition Height="*" />
+            <RowDefinition Height="20" />
+        </Grid.RowDefinitions>
+        <TextBlock Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="4" FontSize="36" Text="Dude!" />
+        <TextBox x:Name="txtNameInput" Grid.Column="2" Grid.Row="2" Text="Default" Width="150" />
+    </Grid>
+</Window>

+ 28 - 0
MainWindow.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace friaLabbar
+{
+    /// <summary>
+    /// Interaction logic for MainWindow.xaml
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+        public MainWindow()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 25 - 0
Models/AddressModel.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace friaLabbar.Models
+{
+    public class AddressModel
+    {
+        public int AddressId { get; set; }
+        public string StreetAddress { get; set; }
+        public string City { get; set; }
+        public string State { get; set; }
+        public string ZipCode { get; set; }
+
+        public string FullAddress
+        {
+            get
+            {
+                return $"{StreetAddress}, {City}, {State}, {ZipCode}";
+            }
+        }
+    }
+}

+ 43 - 0
Models/PasswordCracker.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace friaLabbar.Models
+{
+    public class PasswordCracker
+    {
+        public List<String> PasswordPool { get; set; }
+        public PositionalPasswordCharacter[] PositionalCharacters { get; set; }
+        public PasswordCracker(List<string> passwordPool, uint pwLength = 5, uint numPossibleCharacters = 6)
+        {
+            PasswordPool = passwordPool;
+            PositionalCharacters = new PositionalPasswordCharacter[pwLength];
+            for (uint i = 0; i < pwLength; i++)
+            {
+                PositionalCharacters[i] = new PositionalPasswordCharacter(numPossibleCharacters, i);
+            }
+        }
+
+        public PasswordCracker(uint pwLength = 5, uint numPossibleCharacters = 6)
+            : this(new List<string>(), pwLength, numPossibleCharacters)
+        {
+        }
+
+        public IEnumerable<PossiblePassword> AllPasswords
+        {
+            get 
+            {
+                List<PossiblePassword> result = new List<PossiblePassword>();
+                
+                foreach (string password in PasswordPool)
+                {
+                    result.Add(new PossiblePassword(password, PositionalCharacters));
+                }
+
+                return result; 
+            }
+        }
+    }
+}

+ 29 - 0
Models/PersonModel.cs

@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace friaLabbar.Models
+{
+    public class PersonModel
+    {
+        public int PersonId { get; set; }
+        public string FirstName { get; set; }
+        public string LastName { get; set; }
+        public bool IsAlive { get; set; }
+        public DateTime DateOfBirth { get; set; }
+        public int Age { get; set; }
+        public decimal AccountBalance { get; set; }
+        public List<AddressModel> Addresses { get; set; } = new List<AddressModel>();
+        public AddressModel PrimaryAddress { get; set; }
+
+        public string FullName
+        {
+            get
+            {
+                return $"{FirstName} {LastName}";
+            }
+        }
+    }
+}

+ 37 - 0
Models/PositionalPasswordCharacter.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace friaLabbar.Models
+{
+    public class PositionalPasswordCharacter : HashSet<char>
+    {
+        private uint expectedLength;
+        private string _letterString;
+        public uint Position { get; private set; }
+
+        public string Text
+        {
+            get { return _letterString; }
+            set 
+            {
+                _letterString = value;
+                this.Clear();
+                this.UnionWith(value);
+            }
+        }
+
+        public bool IsComplete { get { return Count >= expectedLength;  } }
+        public bool IsValid { get { return Count <= expectedLength; } }
+
+        public PositionalPasswordCharacter(uint expectedLength, uint position)
+            : base()
+        {
+            this.expectedLength = expectedLength;
+            Text = string.Empty;
+            Position = position;
+        }
+    }
+}

+ 35 - 0
Models/PossiblePassword.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace friaLabbar.Models
+{
+    public class PossiblePassword
+    {
+        public List<PossiblePasswordCharacter> Characters { get; set; }
+        public bool IsPossible
+        {
+            get
+            {
+                return !Characters.Any(i => i.State == CharacterState.Impossible);
+            }
+        }
+        public string Text
+        {
+            get
+            {
+                return String.Concat(Characters.Select(i => i.Character));
+            }
+        }
+        public PossiblePassword(string password, PositionalPasswordCharacter[] characters)
+        {
+            Characters = new List<PossiblePasswordCharacter>();
+            for (int i = 0; i < password.Length; i++)
+            {
+                Characters.Add(new PossiblePasswordCharacter(password[i], characters[i]));
+            }
+        }
+    }
+}

+ 37 - 0
Models/PossiblePasswordCharacter.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace friaLabbar.Models
+{
+    public class PossiblePasswordCharacter
+    {
+        public char Character { get; private set; }
+        public CharacterState State { get; private set; }
+        public PossiblePasswordCharacter(char p, PositionalPasswordCharacter seenCharacters)
+        {
+            Character = p;
+            if (seenCharacters.Contains(p))
+            {
+                State = CharacterState.Possible;
+            }
+            else if (seenCharacters.IsComplete)
+            {
+                State = CharacterState.Impossible;
+            }
+            else
+            {
+                State = CharacterState.Unknown;
+            }
+        }
+    }
+
+    public enum CharacterState
+    {
+        Unknown,
+        Possible,
+        Impossible
+    }
+}

+ 99 - 0
RandomPersonGenerator.cs

@@ -0,0 +1,99 @@
+using friaLabbar.Models;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace friaLabbar
+{
+    public class RandomPersonGenerator
+    {
+        Random rnd = new Random();
+
+        string[] streetAddresses = new string[] { "Stensvedsgatan 7", "Rydsvägen 332B", "Kläppen 12", "Barkaby 98", "Myrbacka 18" };
+        string[] cities = new string[] { "Borlänge", "Linköping", "Leksand", "Dala-Järna", "Sälen", "Stockholm" };
+        string[] states = new string[] { "Dalarna", "Östergötland", "Värmland", "Skåne", "Uppland" };
+        string[] zipCodes = new string[] { "42314", "58330", "79330", "44231" };
+
+        string[] firstNames = new string[] { "Sten", "Sture", "Bertil", "Greta", "Lisa", "Fia", "Sven" };
+        string[] lastNames = new string[] { "Karlsson", "Svensson", "Rödluva", "Ekdal", "Melander" };
+        bool[] aliveStatuses = new bool[] { true, false };
+        DateTime lowEndDate = new DateTime(1943, 1, 1);
+        int daysFromLowDate;
+
+        public RandomPersonGenerator()
+        {
+            daysFromLowDate = (DateTime.Today - lowEndDate).Days;
+        }
+
+        public List<PersonModel> GetPeople(int total = 10)
+        {
+            List<PersonModel> result = new List<PersonModel>();
+
+            for (int i = 0; i < total; i++)
+            {
+                result.Add(GetPerson(i + 1));
+            }
+
+            return result;
+        }
+
+        private PersonModel GetPerson(int id)
+        {
+            PersonModel result = new PersonModel();
+
+            result.PersonId = id;
+            result.FirstName = GetRandomItem(firstNames);
+            result.LastName = GetRandomItem(lastNames);
+            result.IsAlive = GetRandomItem(aliveStatuses);
+            result.DateOfBirth = GetRandomDate();
+            result.Age = GetAgeInYears(result.DateOfBirth);
+            result.AccountBalance = ((decimal)rnd.Next(1, 1000000) / 100);
+
+            int addressCount = rnd.Next(1, 5);
+
+            for (int i = 0; i < addressCount; i++)
+            {
+                result.Addresses.Add(GetAddress(((id - 1) * 5) + i + 1));
+            }
+
+
+            return result;
+        }
+
+        private AddressModel GetAddress(int id)
+        {
+            AddressModel result = new AddressModel();
+
+            result.AddressId = id;
+            result.StreetAddress = GetRandomItem(streetAddresses);
+            result.City = GetRandomItem(cities);
+            result.State = GetRandomItem(states);
+            result.ZipCode = GetRandomItem(zipCodes);
+
+            return result;
+        }
+
+        private T GetRandomItem<T>(T[] obj)
+        {
+            return obj[rnd.Next(0, obj.Length)];
+        }
+
+        private DateTime GetRandomDate()
+        {
+            return lowEndDate.AddDays(rnd.Next(daysFromLowDate));
+        }
+
+        private int GetAgeInYears(DateTime birthday)
+        {
+            DateTime now = DateTime.Today;
+            int age = now.Year - birthday.Year;
+            if (now < birthday.AddYears(age))
+            {
+                age--;
+            }
+            return age;
+        }
+    }
+}

+ 24 - 0
SkoRem.cs

@@ -0,0 +1,24 @@
+using Caliburn.Micro;
+using friaLabbar.ViewModels;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace friaLabbar
+{
+    public class SkoRem : BootstrapperBase
+    {
+        public SkoRem()
+        {
+            Initialize();
+        }
+
+        protected override void OnStartup(object sender, StartupEventArgs e)
+        {
+            DisplayRootViewForAsync<PasswordCrackerViewModel>();
+        }
+    }
+}

+ 91 - 0
ViewModels/PasswordCrackerViewModel.cs

@@ -0,0 +1,91 @@
+using Caliburn.Micro;
+using friaLabbar.Models;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows.Media;
+
+namespace friaLabbar.ViewModels
+{
+    public class PasswordCrackerViewModel
+    {
+        private List<string> passwordPool = new List<string>()
+        {"BELOW", "PLANT", "WHICH", "WORLD", "WATER", "THESE", "THERE", "HOUSE", "WOULD", "WRITE", "ABOUT", "LEARN" };
+        
+        private PasswordCracker pwCracker;
+
+        public BindableCollection<PositionalPasswordCharacter> PossiblePasswords { get; set; }
+        public BindableCollection<PossiblePassword> AllPasswords { get; set; }
+
+        public PasswordCrackerViewModel()
+        {
+            pwCracker = new PasswordCracker(passwordPool);
+            pwCracker.PositionalCharacters[0].Text = "WHLXAS";
+            pwCracker.PositionalCharacters[1].Text = "ORHEQZT";
+            pwCracker.PositionalCharacters[4].Text = "EDQZP";
+            IEnumerable<PossiblePassword> pp = pwCracker.AllPasswords;
+
+            PossiblePasswords = new BindableCollection<PositionalPasswordCharacter>(pwCracker.PositionalCharacters);
+            AllPasswords = new BindableCollection<PossiblePassword>(pwCracker.AllPasswords);
+        }
+    }
+
+    public class PasswordToColorConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value is Boolean)
+            {
+                if ((Boolean)value)
+                {
+                    return Brushes.Gray;
+                }
+                else
+                {
+                    return Brushes.Red;
+                }
+            }
+
+            return Brushes.White;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+
+    public class PasswordCharacterToColorConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            Brush color = Brushes.White;
+            if (value is CharacterState)
+            {
+                switch ((CharacterState)value)
+                {
+                    case CharacterState.Possible:
+                        color = Brushes.Green;
+                        break;
+                    case CharacterState.Impossible:
+                        color = Brushes.Red;
+                        break;
+                    case CharacterState.Unknown:
+                        color = Brushes.White;
+                        break;
+                }
+            }
+
+            return color;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 50 - 0
ViewModels/SkalViewModel.cs

@@ -0,0 +1,50 @@
+using Caliburn.Micro;
+using friaLabbar.Models;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace friaLabbar.ViewModels
+{
+    public class SkalViewModel : PropertyChangedBase
+    {
+        string name;
+
+        public string Name
+        {
+            get { return name; }
+            set
+            {
+                name = value;
+                NotifyOfPropertyChange(() => Name);
+                NotifyOfPropertyChange(() => CanSayHello);
+            }
+        }
+
+        public bool CanSayHello
+        {
+            get { return !string.IsNullOrWhiteSpace(Name); }
+        }
+
+        public BindableCollection<int> AFewNumbers { get; set; }
+
+        public BindableCollection<PersonModel> AFewPeople { get; set; }
+
+        public SkalViewModel()
+        {
+            RandomPersonGenerator pg = new RandomPersonGenerator();
+            AFewNumbers = new BindableCollection<int>(new List<int> { 1, 3, 3, 7, 58, 48, 690 });
+            AFewPeople= new BindableCollection<PersonModel>(pg.GetPeople());
+        }
+
+        public void SayHello()
+        {
+            MessageBox.Show(string.Format("Hello {0}!", Name)); //Don't do this in real life :)
+            AFewNumbers[2] = 15981;
+        }
+
+    }
+}

+ 108 - 0
Views/PasswordCrackerView.xaml

@@ -0,0 +1,108 @@
+<Page x:Class="friaLabbar.Views.PasswordCrackerView"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:friaLabbar.Views"
+      xmlns:viewmodels="clr-namespace:friaLabbar.ViewModels"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+
+      Background="Wheat"
+      Title="PasswordCrackerView">
+    <Page.Resources>
+        <Style TargetType="TextBlock">
+            <Setter Property="Padding" Value="10 10" />
+            <Setter Property="FontSize" Value="20" />
+        </Style>
+        <Style TargetType="TextBox">
+            <Setter Property="Margin" Value="4" />
+        </Style>
+        <viewmodels:PasswordToColorConverter x:Key="passwordToColorConverter" />
+        <viewmodels:PasswordCharacterToColorConverter x:Key="passwordCharacterToColorConverter" />
+    </Page.Resources>
+
+    <Grid Grid.IsSharedSizeScope="True">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="20" />
+            <ColumnDefinition Width="auto" SharedSizeGroup="FirstColumn" />
+            <ColumnDefinition Width="auto" SharedSizeGroup="SecondColumn" />
+            <ColumnDefinition Width="*" />
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="20" />
+            <RowDefinition Height="auto" />
+            <RowDefinition Height="auto" />
+            <RowDefinition Height="auto" />
+        </Grid.RowDefinitions>
+
+
+        <!-- Row 0 -->
+
+        <!-- Row 1 -->
+        <TextBlock Text="Password cracker" FontSize="40" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="4" />
+
+        <!-- Row 2 -->
+        <TextBlock Text="Position" Grid.Row="2" Grid.Column="1" Background="Aqua"/>
+        <TextBlock Text="Seen characters" Grid.Row="2" Grid.Column="2" Background="Turquoise" />
+        <TextBlock Text="Passwords" Grid.Row="2" Grid.Column="3" Background="BlanchedAlmond" />
+
+        <!-- Row 3 -->
+        <ItemsControl ItemsSource="{Binding PossiblePasswords}" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2">
+            <ItemsControl.ItemTemplate>
+                <DataTemplate>
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="auto" SharedSizeGroup="FirstColumn" />
+                            <ColumnDefinition Width="auto" SharedSizeGroup="SecondColumn" />
+                        </Grid.ColumnDefinitions>
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="auto" />
+                        </Grid.RowDefinitions>
+
+                        <TextBlock Text="{Binding Position}" Background="Orchid" Grid.Column="0"/>
+                        <TextBox Text="{Binding Text}" Grid.Column="1" Background="Pink" />
+
+                    </Grid>
+                </DataTemplate>
+            </ItemsControl.ItemTemplate>
+        </ItemsControl>
+
+        <ItemsControl ItemsSource="{Binding AllPasswords}" Grid.Row="3" Grid.Column="3">
+            <ItemsControl.ItemsPanel>
+                <ItemsPanelTemplate>
+                    <WrapPanel />
+                </ItemsPanelTemplate>
+            </ItemsControl.ItemsPanel>
+
+            <ItemsControl.ItemTemplate>
+                <DataTemplate>
+
+                    <Border BorderThickness="1" BorderBrush="Black">
+
+                        <StackPanel Orientation="Horizontal" Margin="10" Background="{Binding IsPossible, Converter={StaticResource passwordToColorConverter}}">
+
+                            <ItemsControl ItemsSource="{Binding Characters}">
+                                <ItemsControl.ItemsPanel>
+                                    <ItemsPanelTemplate>
+                                        <StackPanel Orientation="Horizontal" />
+                                    </ItemsPanelTemplate>
+                                </ItemsControl.ItemsPanel>
+                                <ItemsControl.ItemTemplate>
+                                    <DataTemplate>
+                                        <TextBlock Text="{Binding Character}" Padding="1" FontSize="20" FontWeight="Bold" Foreground="{Binding State, Converter={StaticResource passwordCharacterToColorConverter}}" />
+                                    </DataTemplate>
+                                </ItemsControl.ItemTemplate>
+                            </ItemsControl>
+                        </StackPanel>
+                    </Border>
+
+                </DataTemplate>
+            </ItemsControl.ItemTemplate>
+
+        </ItemsControl>
+
+        <!-- Row 4 -->
+
+    </Grid>
+</Page>

+ 28 - 0
Views/PasswordCrackerView.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace friaLabbar.Views
+{
+    /// <summary>
+    /// Interaction logic for PasswordCrackerView.xaml
+    /// </summary>
+    public partial class PasswordCrackerView : Page
+    {
+        public PasswordCrackerView()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 55 - 0
Views/SkalView.xaml

@@ -0,0 +1,55 @@
+<Page x:Class="friaLabbar.Views.SkalView"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:friaLabbar.Views"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="SkalView">
+
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="20" />
+            <ColumnDefinition Width="auto" />
+            <ColumnDefinition Width="auto" />
+            <ColumnDefinition Width="auto" />
+            <ColumnDefinition Width="auto" />
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="20" />
+        </Grid.ColumnDefinitions>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="20" />
+            <RowDefinition Height="auto" />
+            <RowDefinition Height="auto" />
+            <RowDefinition Height="auto" />
+            <RowDefinition Height="auto" />
+            <RowDefinition Height="auto" />
+            <RowDefinition Height="*" />
+            <RowDefinition Height="20" />
+        </Grid.RowDefinitions>
+        
+        <!-- Row 1 -->
+        <TextBlock Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="4" FontSize="36" Text="Dude!" />
+        
+        <!-- Row 2 -->
+        <TextBox x:Name="txtNameInput" Grid.Column="2" Grid.Row="2" Text="Default" Width="150" />
+
+        <!-- Row 3 -->
+        <StackPanel Grid.Column="3" Grid.Row="3">
+            <Label Content="Hello please write your name" />
+            <TextBox x:Name="Name" />
+            <Button x:Name="SayHello"
+                Content="Click Me" />
+        </StackPanel>
+        
+        <!-- Row 4 -->
+        <ComboBox x:Name="AFewPeople" Grid.Row="4" Grid.Column="2">
+            <ComboBox.ItemTemplate>
+                <DataTemplate>
+                    <TextBlock Text="{Binding FullName}" />
+                </DataTemplate>
+            </ComboBox.ItemTemplate>
+        </ComboBox>
+    </Grid>
+</Page>

+ 28 - 0
Views/SkalView.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace friaLabbar.Views
+{
+    /// <summary>
+    /// Interaction logic for SkalView.xaml
+    /// </summary>
+    public partial class SkalView : Page
+    {
+        public SkalView()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 14 - 0
friaLabbar.csproj

@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>WinExe</OutputType>
+    <TargetFramework>net6.0-windows</TargetFramework>
+    <Nullable>enable</Nullable>
+    <UseWPF>true</UseWPF>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Caliburn.Micro" Version="4.0.212" />
+  </ItemGroup>
+
+</Project>

+ 25 - 0
friaLabbar.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.2.32505.173
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "friaLabbar", "friaLabbar.csproj", "{3299A7AF-ED7C-418C-93E4-5FF4F54B21C2}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{3299A7AF-ED7C-418C-93E4-5FF4F54B21C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3299A7AF-ED7C-418C-93E4-5FF4F54B21C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3299A7AF-ED7C-418C-93E4-5FF4F54B21C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{3299A7AF-ED7C-418C-93E4-5FF4F54B21C2}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {30942FD0-B729-4357-B337-A83C441B968E}
+	EndGlobalSection
+EndGlobal