|
OnMouseDoubleClick from a selectedItem in a listview, I want to retrieve the parent of that selectedItem, and from that, populate several related listviews with the related records.
What is the best way to do this using the MVVM pattern without polluting the view with too much code-behind?
|
|
|
|
|
I hope you get a response for this as I'm a polluter, I use code behind and pass the info to the datacontext
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The generally accepted solution is to use something like EventToCommand.
|
|
|
|
|
I'm pretty sure I told you how to do it when I answered you here[^].
|
|
|
|
|
please help to solve this issue.
Thanks in advance.
|
|
|
|
|
Err, I'm not exactly sure what you're asking here. Are you talking about how to handle the change to the appropriate date format? What code do you currently have to handle the change of culture? Have you put the basics of i18n in place in your application already?
|
|
|
|
|
I used following code to get country list in combobox and my requirement is on selecting country in combobox, date want to update in date picker with respect to current culture.
public List<string> getCountryList()
{
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures);
foreach (CultureInfo culture in cultures)
{
try
{
RegionInfo region = new RegionInfo(culture.Name);
if (!(cultureList.Contains(region.EnglishName)))<br />
{
cultureList.Add(region.EnglishName);
abbrevationtext.Add("en-" + region.TwoLetterISORegionName.ToLower());
}
}<br />
catch (Exception ex)
{
}
}
cultureList.Sort();
return cultureList;
}
|
|
|
|
|
Hi,
I'm integrating some some WPF controls into a MFC dialog box.
One of the control is a media player that shows live video.
The second one is a label that shows the current video time.
What I need is to have is the label on top of the media player. The label should only display the time, so its background needs to be transparent.
Right now, I have the video player running fine inside the dialog box, but I am unable to have the time displayed as I wish. It just overlap the video player.
Both WPF components were creating by following instructions from this link.
https://msdn.microsoft.com/en-us/library/ms742522(v=vs.110).aspx#hosting_a_wpf_page[^]
I try to set the label with a transparent background.
timeLabel->Background = gcnew System::Windows::Media::SolidColorBrush (System::Windows::Media::Colors::Transparent);
But the label background is shown black.
I also try to set the Transparent flag of the MFC CDialog to true, but it didn't have any effect.
How can I that fixed?
Do I need to set up something special when I instantiate the WPF controls?
Do I need to call some functions from inside the MFC dialog box?
Thanks,
Alain Migeon
PS This question has also been asked in "C / C++ / MFC" forum.
|
|
|
|
|
I'm trying to add a DataGridComboBoxColumn to my grid in the code behind:
public List<Person> People = new List<Person>();
People.Add(new Person { Id = 0, Name = "Joe" });
People.Add(new Person { Id = 1, Name = "Pete" });
People.Add(new Person { Id = 2, Name = "Sam" });
System.Windows.Controls.DataGridComboBoxColumn comboCol = new System.Windows.Controls.DataGridComboBoxColumn();
comboCol.Header = "People";
comboCol.ItemsSource = People;
comboCol.DisplayMemberPath = "Name";
comboCol.SelectedValuePath = "Id";
this.taskGrid.Columns.Add(comboCol);
When I run it, the column is added, but the combo does not appear in the row. What am I doing wrong here?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
Kevin Marois wrote: What am I doing wrong here
Trying to add a combo to a datagrid! Sorry I just never allow inline editing of more than the absolute minimum and NEVER allow controls to be included in a datagrid.
Having said that why not include the column at design time and set the visibility of the column at runtime.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This is a really old question, it comes down to a server delivers responses to a request, it does not know who is asking so it cannot respond to a nothing! Polling is the most common solution to this problem.
Or you can implement messaging services, a nasty piece of work.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Xaotiq wrote: Just not as part of EF
You are correct, there was a thread recently on sql server using the notifications, had a problem if there was no change in 36 hours. I believe SignalR is also such a framework from service to client, not database to service.
I have no faith in EF and have never worked successfully with it so I can't help there.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All,
we have done application using WPF .Net framework 3.5.Now I want to migrate application to .Net framework 4.5 but application building successfully.I am not able to see the design (XAML) part.
In Xaml showing many errors as below.Could you please help me out.Thanks in advance
System.ArgumentException
'{DependencyProperty.UnsetValue}' is not a valid value for the 'System.Windows.Controls.Image.Source' property on a Setter.
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CallSynchronizationMode syncMode, WaitHandle timeoutSignal)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action, CallSynchronizationMode syncMode)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func, CallSynchronizationMode syncMode)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass12.<microsoft.expression.designhost.idesignerservice.createdesigner>b__11(RemoteCancellationToken remoteToken)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CallWithCancellation[TResult](CancellationToken cancelToken, Func`2 func)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)
System.ArgumentException
'{DependencyProperty.UnsetValue}' is not a valid value for the 'System.Windows.Controls.Image.Source' property on a Setter.
Server stack trace:
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func)
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken remoteToken)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken cancelToken)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass8.<createdesignerimpl>b__6(IRemoteDesignerService d)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass4`2.<marshalout>b__3()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
System.ArgumentException
'{DependencyProperty.UnsetValue}' is not a valid value for the 'System.Windows.Controls.Image.Source' property on a Setter.
at System.Windows.Setter.Seal()
at System.Windows.SetterBaseCollection.Seal()
at System.Windows.TriggerBase.ProcessSettersCollection(SetterBaseCollection setters)
at System.Windows.Trigger.Seal()
at System.Windows.TriggerCollection.Seal()
at System.Windows.StyleHelper.SealTemplate(FrameworkTemplate frameworkTemplate, Boolean& isSealed, FrameworkElementFactory templateRoot, TriggerCollection triggers, ResourceDictionary resources, HybridDictionary childIndexFromChildID, FrugalStructList`1& childRecordFromChildIndex, FrugalStructList`1& triggerSourceRecordFromChildIndex, FrugalStructList`1& containerDependents, FrugalStructList`1& resourceDependents, ItemStructList`1& eventDependents, HybridDictionary& triggerActions, HybridDictionary& dataTriggerRecordFromBinding, Boolean& hasInstanceValues, EventHandlersStore& eventHandlersStore)
at System.Windows.FrameworkTemplate.Seal()
at System.Windows.FrameworkTemplate.System.Windows.ISealable.Seal()
at System.Windows.StyleHelper.SealIfSealable(Object value)
at System.Windows.ResourceDictionary.SealValue(Object value)
at System.Windows.ResourceDictionary.SealValues()
at System.Windows.ResourceDictionary.AddOwner(DispatcherObject owner)
at System.Windows.ResourceDictionary.PropagateParentOwners(ResourceDictionary mergedDictionary)
at System.Windows.ResourceDictionary.OnMergedDictionariesChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
at System.Windows.ResourceDictionaryCollection.InsertItem(Int32 index, ResourceDictionary item)
at System.Collections.ObjectModel.Collection`1.Add(T item)
at Microsoft.Expression.DesignSurface.View.WPFSceneView.WpfResourceHost.TrySetApplicationResources()
at Microsoft.Expression.DesignSurface.View.WPFSceneView.WpfResourceHost.EndInstanceBuilding()
at Microsoft.Expression.DesignSurface.View.WPFSceneView.CrossDocumentUpdateToken.System.IDisposable.Dispose()
at Microsoft.Expression.Platform.InstanceBuilders.ViewNodeManager.UpdateInstances(IAttachViewRoot siteRoot, IList`1 contextNodes, CancellationToken cancelToken)
at Microsoft.Expression.DesignSurface.View.XamlSceneView.UpdateInstancesInternal()
at Microsoft.Expression.DesignSurface.View.XamlSceneView.UpdateInternal(Boolean updateInstances, Boolean updateReferences)
at Microsoft.Expression.DesignSurface.View.WPFSceneView.UpdateInternal(Boolean updateInstances, Boolean updateReferences)
at Microsoft.Expression.DesignSurface.View.XamlSceneView.Update(Boolean updateReferences)
at Microsoft.Expression.DesignSurface.View.ViewUpdateManager.UpdateInvalidRelatedDocuments(SceneView view)
at Microsoft.Expression.DesignSurface.View.XamlSceneView.EnsureActiveViewUpdated()
at Microsoft.Expression.DesignSurface.View.WPFSceneView.EnsureActiveViewUpdated()
at Microsoft.Expression.DesignSurface.View.XamlSceneView.SetVisible(Boolean visible)
at Microsoft.Expression.DesignSurface.View.WPFSceneView.SetVisible(Boolean visible)
at Microsoft.Expression.DesignSurface.DocumentViewContext.CreateAndOpenView(ISourceItemContext sourceItem, CancellationToken cancelToken, Boolean activate, Boolean ensureOpenInHost, Boolean suppressUI)
at Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass10.<>c__DisplayClass12.<microsoft.expression.designhost.isolation.remoting.iremotedesignerservice.createdesigner>b__f(CancellationToken cancelToken)
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.CallWithCancellation[TResult](IRemoteCancellationToken remoteToken, Func`2 func)
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass10.<microsoft.expression.designhost.isolation.remoting.iremotedesignerservice.createdesigner>b__e()
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<marshalin>b__15()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
|
|
|
|
|
Build in 3.5 and look at the XAML in the designer; and see if you get the same error. This may not even be a 4.5 problem; on the surface, it looks like there is a problem with the "source" for an "image" (IMO... just a guess... no warranty).
|
|
|
|
|
|
All,
I am looking for a control that allows modification of a floormap image.
As it stands the floormaps are cad based and BMPs too, but I want to be able to display them in WPF app and modify them (move walls, add pre-defined icons to it for phone points for example).
The intersoft hospital floor is something Id like to do for example but plan needs to be modifiable at runtime. I think that uses KML type files but not sure how to create them from a CAD image (is that possible?). And then how can they be modified in run-time?
Is this possible? Is there a better / easier file format to use for this project?
Its at the design stage so just getting an idea of how to do it!
Thanks
|
|
|
|
|
|
Thanks. The project died a death and Ive only just seen your message! Appreciate the thought...
|
|
|
|
|
And here I am looking at when I last posted and thinking it was "the future" (March 30 at 16:35) ... Whaaa ?
Only noticed it was 2015 at little later...
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Does anyone have a VS2012 start page? I converted from VS2010 but it's giving me trouble.
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
What do you mean by Start Page, that page where Create new project or Recent projects are given? What problem would it give?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Kevin Marois wrote: but it's giving me trouble. I don't know what sort of trouble you mean, but Google seems to find lots of links[^].
|
|
|
|
|
Google gave me lots of links too.
But none seem to deal using the VS2010 resources in VS2012/13.
|
|
|
|
|
Unfortunately Microsoft tend to change their systems with each new release, so you (almost) have to start from scratch each time. The only thing for it is to plough through their documentation. I have to say that I did once post a query on a similar problem to their development forum, and got some very useful help from them.
|
|
|
|
|
The problem is that all they've provided is the XAML for the start page. No code. It's referring to some resources that are internal to VS2010. And there's no real documentation that I can see.
|
|
|
|
|