Crash Course: Creating User Interfaces Ondřej Pavlica, Matúš Valko Covered Topics •UI Frameworks in .NET •Windows Forms •When to use •Basic concepts •Practical example •Useful (more advanced) features for your semestral projects • • •WPF •When to use (instead of WF) •Basic concepts •Practical example •Examples and concepts useful for your semestral projects > Available UI Frameworks +(A non-exhaustive list) Windows Forms WPF Avalonia > UWP > Uno Platform (Xamarin.Native) > MAUI (Xamarin.Forms) Xamarin.Forms 4.0.0.135214-pre4 (4.0.0 Pre Release 4 ... Game Engines – Unity, Godot Unity UI Tutorial #1 - Create Canvas - Technology Multimedia > Windows Forms +(The supposedly simple drag&drop one) Required Visual Studio Packages > Windows Forms + Released in 2002 + Mostly used in legacy software: +Windows 95+ (.NET 2.0) +Windows 2000+ (.NET 3.5) +Windows XP+ (.NET 4.0) + Or in prototypes: +Windows 7+ (.NET Core 3.0) + Event-driven +Other paradigms can be used, but not natively + Dated API + Really easy to use + Really hard to customize and maintain Obsah obrázku text Popis se vygeneroval automaticky. Basic Windows Forms Concepts Good To Know Obsah obrázku text Popis se vygeneroval automaticky. •Writing to UI Components outside of the UI loop throws an exception – use Invoke() •Windows Forms does not (most of the time) provide generics – LINQ .OfType() solves this •[.NET Core] Use the preview version of Visual Studio to get more mileage out of the designer •You can use async event handlers – but beware of exceptions! Practical Example: MD5 Hasher +Demonstrating: •Basic controls •Multiple windows •IO •Dialog windows •Async code + + Obsah obrázku savci, pes Popis se vygeneroval automaticky. PV080 STUDENTS WPF +It's newer and thereby more in tune with current standards (may be newer, but 2006 is not that new) About +Free and open source graphical subsystem. +Previously known as "Avalon" +Uses DirectX and attempts to provide a consistent programming model for building applications +Separates the user interface from business logic, and resembles similar XML-oriented object models +Supports a broad set of application development features, including an application model, resources, controls, graphics, layout, data binding, documents, and security. Basic concept knowledge +Markup and code behind +Layout, Data binding +Events/Commands +Resources (Static, Dynamic) – styles, triggers +Controls +Converters +PropertyChanged XAML eXtensible Application Markup Language Much like with HTML, you are able to easily write and edit your GUI XAML Obsah obrázku text Popis se vygeneroval automaticky. Obsah obrázku text, snímek obrazovky, černá Popis se vygeneroval automaticky. 3D box skeletons Basic example +Windows +Controls +UserControls +IO +Many more + + Advanced examples