|
I am doing some string operations in the event().
but the problem still is:
in the void event () i define 2 dynamic keys (in a property) depending on the input parameter to the service
after i have done this i use the keys in the other method before calling the service again to retrive two other keys.
but the methodcall_x(keys) is executed before the event is triggered
and keys = null so i can't call the service again.
class x {
MAIN{
Servicecall()
methodcall_x(keys)
}
viod the event(){save result to a property}
}
|
|
|
|
|
What you need to do is to use an Action to return to MAIN once event() method is executed.
Move the methodcall_X(keys) in this Action's handler.
For more info on Actions, check out MSDN.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Ok, thanks i will look in to it
|
|
|
|
|
Hi experts,
I have a small projects based on MVVM. I am using tree view control but I am unable to fire a command when a treeview node is selected. My command is declared in a ViewModel.cs file, command is defined in Command.cs file. the command is being called in XAML page. Codes from these three files are here for your ready reference. I searched web a lot, but did not overcome my problem.
XAML----------
<navigation:Page x:Class="WOManagement.Views.WOMeasurement2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns ="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:my="clr-namespace:EIPControls;assembly=EIPControls"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:lc="clr-namespace:WOManagement.ViewModel"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:newcombo="clr-namespace:WOManagement.ViewModel"
Title="WOMeasurement2 Page" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
d:DesignHeight="659" d:DesignWidth="887">
<UserControl.Resources>
<lc:WOMeasViewModel x:Key="Measurement"></lc:WOMeasViewModel>
</UserControl.Resources>
<sdk:Page.Effect>
<DropShadowEffect/>
</sdk:Page.Effect>
<Grid x:Name="LayoutRoot" Width="888" Height="660" DataContext="{Binding Source={StaticResource Measurement}}" >
<sdk:TreeView Height="230" HorizontalAlignment="Left" Name="trvWOList" VerticalAlignment="Top" Width="315" Margin="5"
ItemsSource="{Binding Path=lstWODetails, Mode=TwoWay}">
<sdk:TreeView.ItemTemplate>
<sdk:HierarchicalDataTemplate ItemsSource="{Binding Path=lstItemCodesTree, Mode=TwoWay}">
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding strWOParent}">
</TextBlock>
<TextBlock Text="{Binding strItemCode}"></TextBlock>
<TextBlock Text="{Binding strstage}"></TextBlock>
</StackPanel>
</sdk:HierarchicalDataTemplate>
</sdk:TreeView.ItemTemplate>
</sdk:TreeView>
</Grid>
</navigation:Page>
viewModel.cs-----------------------
using System.Windows.Input;
using WOManagement.Model;
using WOManagement.Commands;
using System.Windows;
namespace WOManagement.ViewModel
{
public class WOMeasViewModel : WOMeasModel
{
public ICommand test { get { return new check(); } }
}
}
Command.cs---------------
using System;
using System.Windows;
using System.Windows.Input;
using WOManagement.ServiceReference1;
using WOManagement.ViewModel;
using System.Collections;
using System.Collections.ObjectModel;
namespace WOManagement.Commands
{
public class check : ICommand
{
public bool CanExecute(object parameter)
{
return true;
}
public event EventHandler CanExecuteChanged;
public void Execute(object parameter)
{
MessageBox.Show("hi");
}
}
}
please some one help me.
|
|
|
|
|
hi experts,
I myself sorted out this issue. I added following lines above item template. Hope this post will help others.
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectedItemChanged">
<i:InvokeCommandAction x:Name="abc" Command="{Binding Path=test, Mode=TwoWay}">
</i:InvokeCommandAction>
</i:EventTrigger>
</i:Interaction.Triggers>
|
|
|
|
|
Hi All,
I need to create the Captcha Option in Silverlight can anybody help me out.
|
|
|
|
|
Mayur Bheda wrote: Captcha Option
You might get some help
here[^].
There is a free tool here[^] that might help you do this as well.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Hi Abhinav,
I tried this but it did not worked for me. I need this to be incorporated as one of the grid row in an xaml file.
|
|
|
|
|
|
Hello,
I'd like to display my own WPF window at start up, which means I don't need standard splash screen. But, I'd like exactly the same behavior as splash screen. It means my own WPF window should appear right after the aplication started and stay visible until the main application window shows up.
Thank you in advance.
Regards,
Goran
|
|
|
|
|
|
|
Hi,
Due to business requirements, I have to have something like a process to run all the time to retrieve data and do processing with it...
My first guess is to create a windows service so that it can be started and be left running.
Question:
Is windows service the best choice for my requirement or can I have a wcf i.e. .svc file to do the same thing i.e. (get started and be left running all the time). ?
|
|
|
|
|
Yes - a windows service is what you need.
A WCF service is for communications between a two clients or a client and a server. You would use a WCF service *inside* your Windows service.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
A book is what he needs. He's been posting basic stuff in this forum for weeks now, and a good introductory text or two would serve him better.
|
|
|
|
|
Yeah, I know - I decided to take the chance that he would have gotten some form of a clue by now, but I guess not, based on his response to my answer.
In the end, all you can do is point and laugh...
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Well, unfortunately, you keep answering his retarded questions. If you stopped, maybe he *would* get a clue. I think its time Arkiboy stepped up and became an Arkiman and quit depending on people to spoon feed him.
|
|
|
|
|
I'll give him answers to a certain degree, but he's gonna have to cowboy up and do most of the legwork himself.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Just you wait. He will start asking questions like "I went to the toilette, but there are no bathroom tissues. What do I do?"
|
|
|
|
|
I would like to return the data to the GUI from the windows service.
1- Should the GUI call WCF which gets the data from window service?
OR
2- Should the GUI just call the windows service to get the data?
Thanks
|
|
|
|
|
The windows service shouldn't return the data, it should store the data locally, and send out a system-wide message that new data is available. If a desktop application is running that knows about the message, it can then load the data from the local source.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
I see what you mean and this is what I am trying to devlope at present.
But where does WCF come into this?
Thanks
|
|
|
|
|
Buy some books. Read them. Learn from them. Stop expecting us to spoonfeed you.
|
|
|
|
|
|
Just you wait. He will start asking questions like "I left my car keys in another jacket. What do I do?"
|
|
|
|