Click here to Skip to main content
15,886,873 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: C# WPF listbox binding to selected item does not update my property Pin
Member 128805955-Dec-16 9:10
Member 128805955-Dec-16 9:10 
QuestionTabControl views are not disposed Pin
Leif Simon Goodwin23-Nov-16 4:55
Leif Simon Goodwin23-Nov-16 4:55 
AnswerRe: TabControl views are not disposed Pin
Pete O'Hanlon23-Nov-16 5:30
mvePete O'Hanlon23-Nov-16 5:30 
PraiseRe: TabControl views are not disposed Pin
Leif Simon Goodwin23-Nov-16 21:09
Leif Simon Goodwin23-Nov-16 21:09 
QuestionIs there any way to automate the silverlight application using Eclipse-testng-selenium-java frameowork Pin
Ashish khanduri20-Nov-16 18:23
Ashish khanduri20-Nov-16 18:23 
AnswerRe: Is there any way to automate the silverlight application using Eclipse-testng-selenium-java frameowork Pin
Mycroft Holmes20-Nov-16 19:39
professionalMycroft Holmes20-Nov-16 19:39 
GeneralRe: Is there any way to automate the silverlight application using Eclipse-testng-selenium-java frameowork Pin
Ashish khanduri20-Nov-16 19:50
Ashish khanduri20-Nov-16 19:50 
QuestionSound Command that can intercept the Active Thread Pin
Vimalsoft(Pty) Ltd15-Nov-16 17:56
professionalVimalsoft(Pty) Ltd15-Nov-16 17:56 
Good Day all

i am working on a Kinect Sensor Program, but i think this question can best be answered by the WPF forum.

In my Kinect Project , the User can use Kinect Gestures or Voice Commands. THe Gestures work nicely its like one is using a mouse. i have a challenge with the Voice Commands which follow a certain Process. Please note that this functionality works well when one is not using voice commands.

Let me make a simple example.

i have a 3 Buttons

Button 1 = "System Ok "

Button 2 = " View Error"

Button 3 = "System Reboot"


Step 1: Now the logic say , if a user enter a wrong command , the System must play a sound for Error and the button for " View Error" must Animate.

Step 2: The Rule goes on and say if the User has not click the " View Error" within 5 seconds , Stop the Animation on the " View Error"

Step 3: and Animate the "System Reboot" and play the Sound for "System Reboot"

Now on a normal button click with a Mouse , this would work. But now i am not clicking the Button Physically, i am using Voice Commands and i have trapped the SpeechRecognized event which is defined like this
C#
private void SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            // Speech utterance confidence below which we treat speech as if it hadn't been heard
            const double ConfidenceThreshold = 0.3;

            // Number of degrees in a right angle.
            const int DegreesInRightAngle = 90;

            // Number of pixels turtle should move forwards or backwards each time.
            const int DisplacementAmount = 60;

            this.ClearRecognitionHighlights();

            if (e.Result.Confidence >= ConfidenceThreshold)
            {
                switch (e.Result.Semantics.Value.ToString())
                { 

                    case "VIEWERROR":
                        Error_Escaped = true;
                        btnViewError_Click(null, null); 
                        break;
                    case "SYSTEMREBOOT":
                        btnSystemReboot_Click(null, null);
                        break;
                    case "SYSTEMSTATUS":
                        SystemStatus_Click(null, null); 
                        break; 
                }
            }
            else
            {
                // set the status text
                this.Status.Content = Properties.Resources.GrammarConfidenceLow;
                Logger.NormalLog("The Confidence is low , the Grammar is not Recognised as a Command", Generics.Generics.ActivePage) ;
            }
        }

as you can see i am clicking the Buttons programmatically. So if i don't click the "View Error" button within 5 seconds , the System Reboot will start playing another sound.

That was about the Process. Now my challenge is that. After i used a wrong option according to my Process, the "View Error" button will give a sound and i will give a Voice Command to Stop the Sound , the next in the Process will still be fired. So i debugged the code and i realised that the Program , runs all the code that was running and when its done, it hit the "SpeechRecognized" event later, i want to intercept and give the Voice Command the same ability as a button click done with a mouse can do.

This is a function that runs , when there is an Error
private void ViewError()
{

    Error_Escaped = false;
    ResetBlinking(this.btnViewError);
    AnimateButton(this.btnViewError);
     Generics.Generics.WaitNSeconds(5);
     if (Error_Escaped == false)
     {
         SystemReboot();
     }
}

This will set the Flag for "Error_Escape = false " Which means no one has clicked the button. and it will Animate the Button and wait for 5 second which is my custom interval calculator. Now while its waiting i would keep saying some Voice Command to Stop it. it will still continue while i wait , it will jump to System Reboot which will have its sound. i want the

SpeechRecognized(object sender, SpeechRecognizedEventArgs e)

event to fire when i need it not after the other event of buttons are fired.

Tanks

Vuyiswa Maseko
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com

AnswerRe: Sound Command that can intercept the Active Thread Pin
Gerry Schmitz16-Nov-16 6:07
mveGerry Schmitz16-Nov-16 6:07 
QuestionCan't Move Label with mouse in WPF Pin
Dadou5512-Nov-16 22:44
Dadou5512-Nov-16 22:44 
AnswerRe: Can't Move Label with mouse in WPF Pin
Richard Deeming14-Nov-16 2:13
mveRichard Deeming14-Nov-16 2:13 
QuestionHow to achieve grouping and ungrouping usercontrol in wpf application programmatically Pin
Pankaj Deharia10-Nov-16 3:05
professionalPankaj Deharia10-Nov-16 3:05 
AnswerRe: How to achieve grouping and ungrouping usercontrol in wpf application programmatically Pin
Gerry Schmitz10-Nov-16 7:01
mveGerry Schmitz10-Nov-16 7:01 
QuestionHow to solve the echo in a MVVM project with external data updates Pin
ronald6231-Oct-16 0:16
ronald6231-Oct-16 0:16 
AnswerRe: How to solve the echo in a MVVM project with external data updates Pin
Gerry Schmitz4-Nov-16 5:02
mveGerry Schmitz4-Nov-16 5:02 
GeneralRe: How to solve the echo in a MVVM project with external data updates Pin
ronald624-Nov-16 5:15
ronald624-Nov-16 5:15 
GeneralRe: How to solve the echo in a MVVM project with external data updates Pin
Gerry Schmitz4-Nov-16 5:46
mveGerry Schmitz4-Nov-16 5:46 
GeneralRe: How to solve the echo in a MVVM project with external data updates Pin
ronald627-Nov-16 3:38
ronald627-Nov-16 3:38 
GeneralRe: How to solve the echo in a MVVM project with external data updates Pin
Gerry Schmitz7-Nov-16 6:35
mveGerry Schmitz7-Nov-16 6:35 
GeneralRe: How to solve the echo in a MVVM project with external data updates Pin
Pete O'Hanlon7-Nov-16 10:44
mvePete O'Hanlon7-Nov-16 10:44 
GeneralRe: How to solve the echo in a MVVM project with external data updates Pin
Gerry Schmitz7-Nov-16 11:36
mveGerry Schmitz7-Nov-16 11:36 
GeneralRe: How to solve the echo in a MVVM project with external data updates Pin
ronald629-Nov-16 0:01
ronald629-Nov-16 0:01 
GeneralRe: How to solve the echo in a MVVM project with external data updates Pin
Gerry Schmitz10-Nov-16 12:11
mveGerry Schmitz10-Nov-16 12:11 
GeneralRe: How to solve the echo in a MVVM project with external data updates Pin
ronald6221-Nov-16 1:14
ronald6221-Nov-16 1:14 
QuestionPrinting an xps fixed document Pin
Stephen Holdorf5-Oct-16 8:04
Stephen Holdorf5-Oct-16 8:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.