-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathApp.xaml.fs
More file actions
27 lines (22 loc) · 788 Bytes
/
App.xaml.fs
File metadata and controls
27 lines (22 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
namespace FVim
open Avalonia
open Avalonia.Controls
open Avalonia.Controls.Templates
open Avalonia.Markup.Xaml
open System
open log
type ViewLocator() =
interface IDataTemplate with
member this.Build(data: obj): Avalonia.Controls.IControl =
let _name = data.GetType().FullName.Replace("ViewModel", "");
let _type = Type.GetType(_name);
if _type <> null
then Activator.CreateInstance(_type) :?> IControl;
else TextBlock( Text = "Not Found: " + _name ) :> IControl
member this.Match(data: obj): bool =
data :? ViewModelBase
//member this.SupportsRecycling: bool = false
type App() =
inherit Application()
override this.Initialize() =
AvaloniaXamlLoader.Load this