HandyOrg/HandyControl

SideMenu控件没办法动态绑定数据吗?

PiaoYiQiang opened this issue · 7 comments

Describe the bug

hc:TransitioningContentControl
<hc:SideMenu BorderThickness="1" Width="200" Margin="32" ItemsSource="{Binding DataList}">
hc:Interaction.Triggers
<hc:EventTrigger EventName="SelectionChanged">
<hc:EventToCommand Command="{Binding SwitchItemCmd}" PassEventArgsToCommand="True" />
</hc:EventTrigger>
</hc:Interaction.Triggers>
<hc:SideMenu Margin="10">
hc:SideMenu.ItemTemplate

<hc:SideMenuItem Header="{Binding MenuHeader}"/>

</hc:SideMenu.ItemTemplate>
</hc:SideMenu>
</hc:SideMenu>
</hc:TransitioningContentControl>

Steps to reproduce the bug

SideMenu控件没办法动态绑定数据吗?试了很久,是不是这个控件只能把菜单写死

Expected behavior

No response

Screenshots

No response

NuGet package version

None

IDE

Visual Studio 2022

Framework type

.Net 6.0

Windows version

May 2021 Update (19043)

Additional context

No response

我也遇到了这个问题,直接操作SideMenu对象往items添加子项是可以的,MVVM模式双向绑定的方式暂时找到方法,貌似不支持

同问