Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions samples/todoapp/TodoApp.WPF/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:TodoApp.WPF"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
StartupUri="MainWindow.xaml"
ThemeMode="System">
<Application.Resources />
</Application>
32 changes: 0 additions & 32 deletions samples/todoapp/TodoApp.WPF/Converters/BooleanToImageConverter.cs

This file was deleted.

Binary file removed samples/todoapp/TodoApp.WPF/Images/completed.png
Binary file not shown.
Binary file removed samples/todoapp/TodoApp.WPF/Images/incomplete.png
Binary file not shown.
21 changes: 10 additions & 11 deletions samples/todoapp/TodoApp.WPF/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:TodoApp.WPF"
xmlns:conv="clr-namespace:TodoApp.WPF.Converters"
mc:Ignorable="d"
Title="MainWindow" Height="420" Width="800"
ResizeMode="CanMinimize">
<Window.Resources>
<conv:BooleanToImageConverter x:Key="BooleanToImageConverter" />

<DataTemplate x:Key="CompletedIconTemplate">
<Image Width="16" Height="16" Source="{Binding Path=IsComplete, Converter={StaticResource BooleanToImageConverter}}" />
<Grid>
Copy link
Preview

Copilot AI May 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both TextBlock elements inside the Grid may be visible simultaneously when IsComplete is false. Consider adding a Visibility binding (e.g., using an inverse BooleanToVisibility converter) on the second TextBlock so that only the appropriate icon is shown based on the task's completion state.

Copilot uses AI. Check for mistakes.

<TextBlock FontFamily="Segoe Fluent Icons,Segoe MDL2 Assets" Text="&#xEC61;" Visibility="{Binding Path=IsComplete, Converter={StaticResource BooleanToVisibilityConverter}}" />
<TextBlock FontFamily="Segoe Fluent Icons,Segoe MDL2 Assets" Text="&#xEA3A;" />
</Grid>
</DataTemplate>
</Window.Resources>

Expand All @@ -23,7 +23,7 @@
<ListView
x:Name="TodoListView"
ItemsSource="{Binding Items}"
Height="300"
Height="270"
Margin="5"
VerticalAlignment="Top">
<ListView.View>
Expand All @@ -42,27 +42,26 @@
</GroupBox>

<GroupBox Header="Add Task">
<StackPanel Margin="5">
<DockPanel Height="26">
<TextBox x:Name="NewTodoItemTitle"
<StackPanel Margin="5" Height="30" Orientation="Horizontal">
<TextBox x:Name="NewTodoItemTitle"
Width="560"
HorizontalAlignment="Left"
Margin="5,0,5,0"
Text="{Binding AddItemTitle, Mode=TwoWay}"
Text="{Binding AddItemTitle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
VerticalContentAlignment="Center"/>
<Button x:Name="AddTodoItemButton"
Width="75"
HorizontalAlignment="Right"
Content="Add"
Margin="5,0,5,0"
IsDefault="True"
Command="{Binding AddItemCommand}"/>
<Button x:Name="RefreshTodoItemsButton"
<Button x:Name="RefreshTodoItemsButton"
Width="75"
HorizontalAlignment="Right"
Margin="5,0,5,0"
Content="Refresh"
Command="{Binding RefreshItemsCommand}"/>
</DockPanel>
</StackPanel>
</GroupBox>
</StackPanel>
Expand Down
10 changes: 0 additions & 10 deletions samples/todoapp/TodoApp.WPF/TodoApp.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<None Remove="Images\completed.png" />
<None Remove="Images\incomplete.png" />
</ItemGroup>

<ItemGroup>
<Resource Include="Images\completed.png" />
<Resource Include="Images\incomplete.png" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="CommunityToolkit.Datasync.Client" Version="9.0.2" />
Expand Down