blob: 41120e185c68f5745b48b2464ef22ba37d32f10a (
plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.Commands;
using Tango.SharedUI;
namespace Tango.Stubs.UI.ViewModels
{
public class CodeTabVM : ViewModel
{
private String _title;
private String _code;
public String Code
{
get { return _code; }
set { _code = value; RaisePropertyChanged(nameof(Code)); }
}
public String Title
{
get
{
return File != null ? Path.GetFileName(File) : _title;
}
set
{
_title = value;
RaisePropertyChanged(nameof(Title));
}
}
private String _file;
public String File
{
get { return _file; }
set
{
_file = value;
RaisePropertyChanged(nameof(File));
RaisePropertyChanged(nameof(Title));
}
}
private RelayCommand _insertCodeSnippetCommand;
public RelayCommand InsertSnippetCommand
{
get { return _insertCodeSnippetCommand; }
set { _insertCodeSnippetCommand = value; RaisePropertyChanged(nameof(InsertSnippetCommand)); }
}
public CodeTabVM()
{
Title = "untitled";
Code = Properties.Resources.CodeTabTemplate;
}
public override string ToString()
{
return Title;
}
}
}
|