Expand Search Charm programmatically - winrt-xaml

Is it possible to expand the search charm programmatically? I want to have a search button in my windows 8 app which expands the search charm.

According to Object Browser:
public void Show(string query)
Member of Windows.ApplicationModel.Search.SearchPane.
see http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.search.searchpane.show.aspx

Windows.ApplicationModel.Search.SearchPane.GetForCurrentView().Show();

Hi add this below method in App.xaml.cs file
protected async override void OnSearchActivated Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
{
}

Related

Is there a way to run JBehave from with in main method like Cucumber's Main.run() method

I would like to initiate running of the BDD stories from with a Java's main method. Just like cucucumber's Main.run(), is there a similar way to specify JBehave configuration settings to a method and run it.
TIA
It can be done via extension of JUnitStory/JUnitStories and adding main method:
import org.jbehave.core.junit.JUnitStories;
public class MyStories extends JUnitStories {
// add configuration here
public static void main(String[] args) throws Throwable {
new MyStories().run();
}
}
Full example including full sample configuration can be found in the official JBehave repository: org/jbehave/examples/executable_jar/MyStories.java

How to add custom code to the 'Post' action from the GL Post Transactions screen

I need to add custom code to the logic which posts transactions on the GL 'Post Transactions' screen. After going through the T300 documentation and looking at the override of 'Release' to use as an example, I cannot find anything in the 'BatchPost' BLC that remotely resembles a posting process event/method that I can override. Where would I find that logic and what's the best way to add my custom code to the Posting process, batch by batch?
I think the best way to override posting process is to override PX.Objects.GL.PostGraph.PostBatchProc(Batch b, bool createintercompany)
All logic related to posting are located there.
Here is an example:
public class PostGraphExt : PXGraphExtension<PostGraph>
{
public delegate Batch PostBatchProcDelegate(Batch b, bool createintercompany);
[PXOverride]
public virtual void PostBatchProc(Batch b, bool createintercompany, PostBatchProcDelegate baseMethod)
{
//your code here
baseMethod(b, createintercompany);
//or here
}
}

Getting Change Event to Fire in SyncFusion's SFAutoComplete Control

I am trying to use the SFAutoComplete control from SyncFusion in a Xamarin iPad app. (only iPad).
I am not able to get any sort of change event to fire.
What I've tried:
If you download SyncFusion and install it, it comes with a "SampleBrowser" app that has samples for all the controls in the suite.
If you open that SampleBrowser in visual studio and open the AutoComplete_Tablet.cs file after line 97, I've added this code:
countryAutoComplete.ValueChanged += (sender, args) =>
{
suggestionModeLabel.Text = "IT WORKED!";
};
But it never fires.
I've tried to use several different events from the list of events this control has (partial list from screenshot):
None of them seem to fire (I haven't tried ALL of them).
What do I need to do to get one of these events to fire? What am I missing?
Thanks for using Syncfusion Controls.
Delegate property can be used to hook the SFAutoComplete's events as per in the following code example,
Declaration code for Delegate property
SFAutoComplete autocomplete = new SFAutoComplete();
autocomplete.Delegate = new SFAutoCompleteDelegate();
The way to hook the events in SFAutoComplete
public class SFAutoCompleteDelegate : AutoCompleteDelegate
{
public override void DidTextChange(SFAutoComplete SFAutoComplete, string value)
{
//It fired while changing the text in AutoComplete
}
public override void DidSelectionChange(SFAutoComplete SFAutoComplete, string value)
{
//It fired while changing the suggestion from suggestion box.
}
}
We have created a sample for achieving your requirement. Please download the same from the following link
Link:http://www.syncfusion.com/downloads/support/forum/125261/ze/testingAutoComplete_21799375630
Thanks & Regards,
Hemalatha M.R

Wiring up the Search Charm in Universal WinRT apps

I haven't seen any examples of how to use the Search Charm in a Universal App.
Usually you wire up the Search Charm using:
SearchPane.GetForCurrentView().QuerySubmitted += new TypedEventHandler<SearchPane, SearchPaneQuerySubmittedEventArgs>(OnQuerySubmitted);
However that doesn't exist in the Shared App.xaml nor does the Windows.ApplicationModel.Search namespace.
Anyone seen how to accomplish this?
I think you just need to override the OnSearchActivated method in App.xaml.cs:
protected override async void OnSearchActivated(SearchActivatedEventArgs args)
{
await LoadApplicationAsync(args.PreviousExecutionState);
// TODO: Handle search query in args
}
LoadApplicationAsync contains the logic which can usually be found in the OnLaunched method.
See my sample project:
https://xp-dev.com/svn/mytoolkit/-%20Samples/SampleWindowsStoreApp/App.xaml.cs
https://xp-dev.com/svn/mytoolkit/-%20Samples/SampleWindowsStoreApp/Views/SearchSamplePage.xaml.cs

cannot find how 'F1' key works in application

My application is built in MFC.After the application executes I need to open the help file provided with exe.
But as I press F1 application gives an error message saying the file cannot be found. This happens because no such file of that name exist.
One would think how about changing the name of help file itself? well that cannot be done I have to change the path as well.
I need to know how does the function of F1 button work and where can I find the same?
I am using VC++ 6.0 (I know its very old, but I am stuck with it).
Thank you.
To show your specific help file, you have to overwrite CWinApp::OnHelp. The path to the standard help file is stored in CWinApp::m_pszHelpFilePath. In this example, I use my own m_path variable.
void CMyApp::OnHelp()
{
::HtmlHelp(((CMainFrame*)AfxGetMainWnd())->m_hWnd,m_path,HH_DISPLAY_TOPIC,NULL);
}
If I remember correctly, by default it's handled by CWinApp::OnHelp() so take a look at your override of the application class first, you may find the ON_COMMAND handler there.
I had an class that extends CWinApp, so overwriting the OnHelp function worked this way:
In the header:
class MyApp : public CWinApp
{
public:
afx_msg void OnHelp();
}
In the cpp file:
BEGIN_MESSAGE_MAP(MyApp, CWinApp)
ON_COMMAND(ID_HELP, MyApp::OnHelp)
END_MESSAGE_MAP()
void MyApp::OnHelp()
{
// your own help function
}

Resources