• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

http://sourceforge.jp/projects/futonwriter/の旧リポジトリ


Commit MetaInfo

Revision0584f46af297dbbac6f67db02a21f239fd96bde9 (tree)
Zeit2011-05-20 19:58:27
Autorazyobuzin <azyobuzin@user...>
Commiterazyobuzin

Log Message

・タブ追加のメソッドを作成
・TabControlの背景色を変更

Ändern Zusammenfassung

Diff

--- a/HatenaDiaryClient/Models/Model.cs
+++ b/HatenaDiaryClient/Models/Model.cs
@@ -19,7 +19,7 @@ namespace Azyobuzi.HatenaDiaryClient.Models
1919 internal Model()
2020 {
2121 this.Tabs = new DispatcherCollection<Tab>(DispatcherHelper.UIDispatcher);
22- this.Tabs.Add(new Tab() { Editing = new BlogItem(), TitleText = "新規" });
22+ this.AddTab(null);
2323 }
2424
2525 private Settings settings;
@@ -80,5 +80,27 @@ namespace Azyobuzi.HatenaDiaryClient.Models
8080 tab.TitleText = re.Title;
8181 tab.Modified = false;
8282 }
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+ }
83105 }
84106 }
--- a/HatenaDiaryClient/Views/MainWindow.xaml
+++ b/HatenaDiaryClient/Views/MainWindow.xaml
@@ -60,7 +60,7 @@
6060 </Button>
6161 </WrapPanel>
6262
63- <TabControl Grid.Row="2" ItemsSource="{Binding Tabs}" SelectedItem="{Binding SelectedTab}">
63+ <TabControl Grid.Row="2" ItemsSource="{Binding Tabs}" SelectedItem="{Binding SelectedTab}" Background="LightCyan">
6464 <TabControl.ItemTemplate>
6565 <DataTemplate>
6666 <DataTemplate.Resources>