Add ratings cell tool tips
This commit is contained in:
parent
b4838d364e
commit
b97d8e9403
@ -4,7 +4,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="LibationAvalonia.Controls.MyRatingCellEditor">
|
||||
|
||||
|
||||
<Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto,Auto,Auto">
|
||||
<Grid.Styles>
|
||||
<Style Selector="TextBlock">
|
||||
|
||||
@ -2,7 +2,6 @@ using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Media;
|
||||
using DataLayer;
|
||||
|
||||
namespace LibationAvalonia.Controls
|
||||
@ -28,6 +27,8 @@ namespace LibationAvalonia.Controls
|
||||
IsEnabled = false
|
||||
};
|
||||
|
||||
ToolTip.SetTip(cell, "Click to change ratings");
|
||||
|
||||
if (Binding != null)
|
||||
{
|
||||
myRatingElement.Bind(BindingTarget, Binding);
|
||||
@ -46,6 +47,8 @@ namespace LibationAvalonia.Controls
|
||||
Margin = new Thickness(3)
|
||||
};
|
||||
|
||||
ToolTip.SetTip(cell, null);
|
||||
|
||||
return myRatingElement;
|
||||
}
|
||||
|
||||
|
||||
@ -44,8 +44,9 @@ namespace LibationWinForms.GridView
|
||||
{
|
||||
if (value is Rating rating)
|
||||
{
|
||||
ToolTipText = "Click to change ratings";
|
||||
|
||||
var starString = rating.ToStarString();
|
||||
ToolTipText = starString;
|
||||
base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, starString, starString, errorText, cellStyle, advancedBorderStyle, paintParts);
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user