File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 3
3
xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
4
xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
5
5
xmlns : local =" using:Signal_Windows.Controls"
6
+ xmlns : model =" using:Signal_Windows.Models"
6
7
xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
7
8
xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
8
9
mc : Ignorable =" d"
26
27
<TextBlock Grid.Column=" 0" Name =" ConversationDisplayName" FontSize =" 15" FontWeight =" SemiLight" Text =" {x:Bind Model.ThreadDisplayName, Mode=OneWay}" TextTrimming =" CharacterEllipsis" />
27
28
<TextBlock x : Name =" LastActiveTextBlock" Grid.Column=" 1" Text =" {x:Bind LastMessageTimestamp, Mode=OneWay}" FontSize =" 11" Foreground =" #999999" TextTrimming =" CharacterEllipsis" />
28
29
</Grid >
29
- <TextBlock Text =" {x:Bind LastMessage, Mode=OneWay}" FontSize =" 12" />
30
+ <Grid >
31
+ <Grid .ColumnDefinitions>
32
+ <ColumnDefinition Width =" *" />
33
+ <ColumnDefinition Width =" Auto" />
34
+ </Grid .ColumnDefinitions>
35
+ <TextBlock Grid.Column=" 0" Text =" {x:Bind LastMessage, Mode=OneWay}" FontSize =" 12" />
36
+ <Grid Grid.Column=" 1" Width =" 20" Height =" 20" Margin =" 10 0 0 0" >
37
+ <Ellipse Fill =" #2190EA" Visibility =" {x:Bind UnreadStringVisibility, Mode=TwoWay}" />
38
+ <TextBlock Text =" {x:Bind UnreadString, Mode=TwoWay}" FontWeight =" Bold" FontSize =" 12" Foreground =" White" HorizontalAlignment =" Center" VerticalAlignment =" Center" />
39
+ </Grid >
40
+ </Grid >
30
41
</StackPanel >
31
42
</Grid >
32
43
</UserControl >
Original file line number Diff line number Diff line change @@ -42,6 +42,26 @@ public uint UnreadCount
42
42
{
43
43
_UnreadCount = value ;
44
44
PropertyChanged ? . Invoke ( this , new PropertyChangedEventArgs ( nameof ( UnreadString ) ) ) ;
45
+ PropertyChanged ? . Invoke ( this , new PropertyChangedEventArgs ( nameof ( UnreadStringVisibility ) ) ) ;
46
+ }
47
+ }
48
+
49
+ public Visibility UnreadStringVisibility
50
+ {
51
+ get
52
+ {
53
+ if ( UnreadCount > 0 )
54
+ {
55
+ return Visibility . Visible ;
56
+ }
57
+ else
58
+ {
59
+ return Visibility . Collapsed ;
60
+ }
61
+ }
62
+ set
63
+ {
64
+ // we never set this
45
65
}
46
66
}
47
67
@@ -58,6 +78,10 @@ public string UnreadString
58
78
return "" ;
59
79
}
60
80
}
81
+ set
82
+ {
83
+ // we never set this
84
+ }
61
85
}
62
86
63
87
private string _LastMessage = "@" ;
You can’t perform that action at this time.
0 commit comments