Wednesday, 15 July 2015

c# - Command Binding works in designer/VS, but not build/release -



c# - Command Binding works in designer/VS, but not build/release -

i may overlooking obvious here, can't see life of me right now.

i've got interaction on user command (data grid) has item source bound icollectionview, datacontext inherited parent window:

<datagrid margin="0" itemssource="{binding itemsview}" autogeneratecolumns="false" isreadonly="true" selecteditem="{binding selecteditem, mode=twoway}"> <datagrid.columns> .... </datagrid.columns> <i:interaction.triggers> <i:eventtrigger eventname="mousedoubleclick"> <i:invokecommandaction command="{binding onnotifypeg}"/> </i:eventtrigger> </i:interaction.triggers> </datagrid>

the datacontext inherited parent window, has tabbed view:

<window x:class="configbrowser.views.configview" datacontext="{binding configviewmodel, source={staticresource locator}}"> <grid background="{dynamicresource {x:static systemcolors.controllightbrushkey}}"> <tabcontrol height="auto" width="auto" background="{dynamicresource {x:static systemcolors.controllightbrushkey}}"> <tabitem header="overview"> <controls:overview/> </tabitem>

for now, onnotifypeg command opens window (via service, messagebox debug now)

public icommand onnotifypeg { { homecoming new delegatecommand(notifypeg); } } public void notifypeg() { messagebox.show("notify peg", "clicked"); _detailservice.viewpeg(selecteditem); }

whilst running within visual studio, works fine - uc fires off command.

but when run debug or release folders, nil happens. no error, no window, nil - far can tell, it's not bound in built application?

edit: add, columns still load info fine itemsource (which uses info context).

edit 2: if move info grid out of user command , set tab directly, it's doing same behaviour. don't think it's related that.

edit 3: solved in comments - looks costura fails @ embedding system.windows.interactivity.

you have add together reference of system.windows.interactivity , utilize eventtrigger

c# wpf mvvm simple-mvvm

No comments:

Post a Comment