summaryrefslogtreecommitdiff
path: root/Juick/MainPage.xaml.cs
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2012-02-12 01:53:36 +0400
committerGravatar Vitaly Takmazov2012-02-12 01:53:36 +0400
commit6a92a6a4d27dc07f8b32bd7d57ffbcbe15630ab9 (patch)
treecf62fc48a13eb5b8744b361acf47bdcd820751a1 /Juick/MainPage.xaml.cs
parent49eb44f852ab21e72c17bbc436ffa79525a1aba3 (diff)
Avatars support + broken clickable urls
Diffstat (limited to 'Juick/MainPage.xaml.cs')
-rw-r--r--Juick/MainPage.xaml.cs44
1 files changed, 41 insertions, 3 deletions
diff --git a/Juick/MainPage.xaml.cs b/Juick/MainPage.xaml.cs
index 4468f6a..1654c1b 100644
--- a/Juick/MainPage.xaml.cs
+++ b/Juick/MainPage.xaml.cs
@@ -64,19 +64,57 @@ namespace Juick
((ListBox)sender).SelectedIndex = -1;
}
- private void ApplicationBarIconButton_Click(object sender, EventArgs e)
+ public static string GetInlineList(TextBlock element)
+ {
+ if (element != null)
+ return element.GetValue(InlineList) as string;
+ return string.Empty;
+ }
+
+ public static void SetInlineList(TextBlock element, string value)
+ {
+ if (element != null)
+ element.SetValue(InlineList, value);
+ }
+
+ public static readonly DependencyProperty InlineList =
+ DependencyProperty.RegisterAttached(
+ "InlineList",
+ typeof(List<Inline>),
+ typeof(MainPage),
+ new PropertyMetadata(null, OnInlineListPropertyChanged));
+
+ private static void OnInlineListPropertyChanged(DependencyObject obj,
+ DependencyPropertyChangedEventArgs e)
+ {
+ var tb = obj as TextBlock;
+ if (tb != null)
+ {
+ // clear previous inlines
+ tb.Inlines.Clear();
+
+ // add new inlines
+ var inlines = e.NewValue as List<Inline>;
+ if (inlines != null)
+ {
+ inlines.ForEach(inl => tb.Inlines.Add((inl)));
+ }
+ }
+ }
+
+ private void ApplicationBarIconButtonClick(object sender, EventArgs e)
{
App.ViewModel.MyFeed.Clear();
App.ViewModel.Last.Clear();
App.ViewModel.LoadData();
}
- private void ApplicationBarMenuItem_Click(object sender, EventArgs e)
+ private void ApplicationBarMenuItemClick(object sender, EventArgs e)
{
App.Account.SignOut(this);
}
- private void ApplicationBarIconButton_Click_1(object sender, EventArgs e)
+ private void ApplicationBarIconButtonClick1(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/NewPostView.xaml", UriKind.Relative));
}