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