http://sourceforge.jp/projects/futonwriter/の旧リポジトリ
Revision | 0584f46af297dbbac6f67db02a21f239fd96bde9 (tree) |
---|---|
Zeit | 2011-05-20 19:58:27 |
Autor | azyobuzin <azyobuzin@user...> |
Commiter | azyobuzin |
・タブ追加のメソッドを作成
・TabControlの背景色を変更
@@ -19,7 +19,7 @@ namespace Azyobuzi.HatenaDiaryClient.Models | ||
19 | 19 | internal Model() |
20 | 20 | { |
21 | 21 | this.Tabs = new DispatcherCollection<Tab>(DispatcherHelper.UIDispatcher); |
22 | - this.Tabs.Add(new Tab() { Editing = new BlogItem(), TitleText = "新規" }); | |
22 | + this.AddTab(null); | |
23 | 23 | } |
24 | 24 | |
25 | 25 | private Settings settings; |
@@ -80,5 +80,27 @@ namespace Azyobuzi.HatenaDiaryClient.Models | ||
80 | 80 | tab.TitleText = re.Title; |
81 | 81 | tab.Modified = false; |
82 | 82 | } |
83 | + | |
84 | + public Tab AddTab(BlogItem entry) | |
85 | + { | |
86 | + string tabText; | |
87 | + if (entry == null) | |
88 | + { | |
89 | + entry = new BlogItem(); | |
90 | + tabText = "新規"; | |
91 | + } | |
92 | + else | |
93 | + { | |
94 | + tabText = entry.Draft != null ? | |
95 | + entry.Draft.Title : entry.Entry.Title; | |
96 | + } | |
97 | + var tab = new Tab() | |
98 | + { | |
99 | + Editing = entry, | |
100 | + TitleText = tabText | |
101 | + }; | |
102 | + this.Tabs.Add(tab); | |
103 | + return tab; | |
104 | + } | |
83 | 105 | } |
84 | 106 | } |
@@ -60,7 +60,7 @@ | ||
60 | 60 | </Button> |
61 | 61 | </WrapPanel> |
62 | 62 | |
63 | - <TabControl Grid.Row="2" ItemsSource="{Binding Tabs}" SelectedItem="{Binding SelectedTab}"> | |
63 | + <TabControl Grid.Row="2" ItemsSource="{Binding Tabs}" SelectedItem="{Binding SelectedTab}" Background="LightCyan"> | |
64 | 64 | <TabControl.ItemTemplate> |
65 | 65 | <DataTemplate> |
66 | 66 | <DataTemplate.Resources> |