c# 4.0 - How to partial fill the rectangle within canvas in xaml -
c# 4.0 - How to partial fill the rectangle within canvas in xaml -
i have coordinates position on have show clickable button. within button created rectangle , working expected have show partially filled rectangle within rectangle bottom border. below code :
<stackpanel> <button width="{binding width}" height="{binding height}" tooltipservice.tooltip="{binding name}" command="{binding datacontext.eventtriggercommand, elementname=xyzcoord}" commandparameter="{binding}"> <button.template> <controltemplate> <rectangle fill="{binding users_auth_info}" opacity="0" stretch="uniformtofill"/> </controltemplate> </button.template> <button.rendertransform> <translatetransform x="{binding x}" y="{binding y}"/> </button.rendertransform> </button> <border borderbrush="red" height="{binding thickness_param}" borderthickness="8"> <border.rendertransform> <translatetransform x="{binding x}" y="{binding y}"/> </border.rendertransform> </border>
right i'm showing transparent rectangle border border not want.please advise.
use button instead of border , within button utilize rectangle. attached code
<stackpanel> <button width="{binding width}" height="{binding height}" tooltipservice.tooltip="{binding name}" command="{binding datacontext.eventtriggercommand, elementname=xyzcoord}" commandparameter="{binding}"> <button.template> <controltemplate> <rectangle fill="{binding users_auth_info_color}" opacity="0" stretch="uniformtofill"/> </controltemplate> </button.template> <button.rendertransform> <translatetransform x="{binding x}" y="{binding y}"/> </button.rendertransform> </button> <button width="{binding width}" height="{binding thickness_param}" tooltipservice.tooltip="{binding name}" command="{binding datacontext.eventtriggercommand, elementname=xyzcoord}" commandparameter="{binding}"> <button.template> <controltemplate> <rectangle fill="{binding users_auth_info_color}" stretch="uniformtofill"/> </controltemplate> </button.template> <button.rendertransform> <translatetransform x="{binding x}" y="{binding y}"/> </button.rendertransform> </button> </stackpanel>
c#-4.0 windows-store-apps winrt-xaml
Comments
Post a Comment