c# - Line element doesn't get properly focus when selected -
i have .xaml file, looks like:
<resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:lineelement="clr-namespace:...lineelement" xmlns:mvvmwpfbehavior="clr-namespace:gno.libraries.wpfmvvm.behaviors.focus;assembly=gno.libraries.wpfmvvm"> <datatemplate datatype="{x:type lineelement:lineelementviewmodel}"> <grid> <line stroke="darkblue" x1="{binding px1}" y1="{binding py1}" x2="{binding px2}" y2="{binding py2}" strokethickness="3" visibility="visible" stretch="fill"> </line> </grid> </datatemplate> </resourcedictionary>
if have set coordinates in lineelementviewmodel.cs as: px1=0, py1=0, px2=150, py2=0, view:
with proper focus selection can see.
if change coordinates to: px1=0, py1=0, px2=0, py2=150, view:
which behaving want. can see focus selected appropriately.
the problem comes when resize or stretch (i able since use stretch="fill"
) line this:
when change x1, y1 etc. coordinates before make vertical, focus when select line element doesn't updated.
Comments
Post a Comment