Skip to content

Commit

Permalink
make quoted posts clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargaj committed Sep 11, 2024
1 parent d16e236 commit 8eeecec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions BlueWP/Controls/Post/Post.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
</Border>

<!-- quote post -->
<Border BorderThickness="1" CornerRadius="5" BorderBrush="{ThemeResource AppBarItemDisabledForegroundThemeBrush}" Padding="5">
<Button BorderThickness="1" Click="QuotedPost_Click" Background="Transparent" BorderBrush="{ThemeResource AppBarItemDisabledForegroundThemeBrush}" Padding="5">
<i:Interaction.Behaviors>
<c:DataTriggerBehavior Binding="{Binding HasQuotedPost}" Value="True">
<c:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
Expand All @@ -149,7 +149,7 @@
</c:DataTriggerBehavior>
</i:Interaction.Behaviors>
<local:PostQuoted PostData="{Binding QuotedPost}"/>
</Border>
</Button>

<!-- engagement counters -->
<Grid Margin="0,10,0,0">
Expand Down
9 changes: 9 additions & 0 deletions BlueWP/Controls/Post/PostBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,15 @@ protected void MediaPlayerElement_Loaded(object sender, Windows.UI.Xaml.RoutedEv
mediaPlayer.Source = Windows.Media.Core.MediaSource.CreateFromUri(new Uri(video.playlist));
}

protected async void QuotedPost_Click(object sender, RoutedEventArgs e)
{
if (QuotedPost == null)
{
return;
}
await _mainPage.SwitchToThreadViewInlay(QuotedPost.uri);
}

public event PropertyChangedEventHandler PropertyChanged;

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions BlueWP/Controls/Post/PostSelected.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
</Border>

<!-- quote post -->
<Border BorderThickness="1" CornerRadius="5" BorderBrush="{ThemeResource AppBarItemDisabledForegroundThemeBrush}" Padding="5">
<Button BorderThickness="1" Click="QuotedPost_Click" Background="Transparent" BorderBrush="{ThemeResource AppBarItemDisabledForegroundThemeBrush}" Padding="5">
<i:Interaction.Behaviors>
<c:DataTriggerBehavior Binding="{Binding HasQuotedPost}" Value="True">
<c:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
Expand All @@ -104,7 +104,7 @@
</c:DataTriggerBehavior>
</i:Interaction.Behaviors>
<local:PostQuoted PostData="{Binding QuotedPost}"/>
</Border>
</Button>

<TextBlock Grid.Row="2" Text="{Binding PostDateTime}" TextWrapping="WrapWholeWords" Margin="0,10,0,10" Foreground="{ThemeResource TextBoxDisabledForegroundThemeBrush}"/>

Expand Down

0 comments on commit 8eeecec

Please sign in to comment.