How can I use the ItemHeaderTapped event of the devexpress.maui.controls tabview? - event-handling

The goal is to load/reload data for a tab when it is selected.
However for some reason I can't get it to run.
The code in xaml file looks like this:
...
<dxco:TabView ItemHeaderTapped="LoadTab">
<dxco:TabViewItem HeaderText="Tab1">
...
</dxco:TabViewItem>
...
</dxco:TabView>
On the SampleViewModel file I tried this:
private void LoadTab(Object sender, ItemHeaderTappedEventArgs e)
{
...
}
I also tried EventArgs instead of ItemHeaderTappedEventArgs.
But in both cases I get the error:
"EventHandler 'LoadTab' with correct signature not found in type Project.View.SamplePage"
Documentation to this Event is found here:
https://docs.devexpress.com/MAUI/DevExpress.Maui.Controls.TabView.ItemHeaderTapped
What am I doing wrong? Any help appreciated as I could not find any further information using google.

Related

Tweetinvi - User.GetAuthenticatedUser is not being recognized by Visual Studio

I am using Tweetinvi api in Visual Studio and trying to fetch my profile name and profile photo.I followed the documentation on git and was trying to replicate the same in my code ,however it is not recognizing the method GetAuthenticatedUser
var authenticateduser = User.GetAuthenticatedUser();
I have seen some questions like this that said ,you need to give your keys to the method below, however i am doing that and am able to post and fetch tweets
Auth.SetUserCredentials("key1",key2","key3,"key4")
This is my Pageload code
protected void Page_Load(object sender, EventArgs e)
{
Auth.SetUserCredentials("key1",key2","key3,"key4")
var authenticateduser = User.GetAuthenticatedUser();
FetchTweets();
}
i had imported Tweetinvi but somehow this particular function is not being picked up
so have to use code with
var authenticateduser = Tweetinvi.User.GetAuthenticatedUser();
LblProfileName.Text = authenticateduser.Name;
ImgProfile.ImageUrl = authenticateduser.ProfileImageUrl;

I'm making a Roblox exploit using WeAreDevs and I have this error. What is the problem with my text? (CS1061)

public partial class Form1 : Form {
WeAreDevs_API.ExploitAPI aPI = new WeAreDevs_API.ExploitAPI();
public Form1() {
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e) {
aPI.LaunchExploit();
}
private void button2_Click(object sender, EventArgs e) {
fastColoredTextBox1.Clear();
}
private void button3_Click(object sender, EventArgs e) {
aPI.SendFullLuaScript(fastColoredTextBox1.Text);
}
}
This is my problem something close to the ExploitApi Area.
According to Microsoft's docs around the compiler error, CS1061, this is caused by trying to call a function or access a property on an object that does not have that field.
Looking at the documentation for the WeAreDevs API, it looks like SendFullLuaScript() isn't a real function. It looks like you want SendScript() instead.
Be aware that exploits are explicitly disallowed in Roblox's Terms of Service and you will likely be banned if you are caught using them.
In WeAreDevs API (V1), there isn't any function named SendFullLuaScript(). You must replace the SendFullLuaScript() fuction to SendLimitedLuaScript() function.
Using these exploit are violating Roblox's Terms of Service. And WeAreDevs API is not a good exploit to exploiting secure. Yeah, if you continue exploiting, it is very high quality to will be get banned from Roblox.
Goodluck ^^
Replace
aPI.SendFullLuaScript(fastColoredTextBox1.Text);
with
aPI.SendLuaScript(fastColoredTextBox1.Text);
Viewing the documenation: https://wearedevs.net/d/Exploit%20API, SendFullLuaScript is not a method of the latest version of the API. The previous method name was SendLimitedLuaScript, but that is now deprecated in favor of SendLuaScript.

Wicket: How to add substring to every error message?

We are using wicket 6.
Both Session and Component classes have error() method to display an error. However in both cases these methods are final.
Is there any other universal way to add postfix to any error message? (we are looking to add error id)
Edit:
We have hundreds of files of code which already uses error() method from both Session and Component, so massive refactoring is not an option.
You can add arbitrary message objects to a Wicket component:
component.error(new ErrorCode(code));
With a custom FeedbackPanel you can then display the error code as needed:
protected Component newMessageDisplayComponent(String id, FeedbackMessage message)
{
Serializable rawMessage = message.getMessage();
if (rawMessage instanceof ErrorCode) {
// create custom component to display a text and/or code
...
} else {
return super.newMessageDisplayComponent(id, message);
}
}

Parse HL7 v2.3 REF message with local customizations in HAPI

I am trying parse a HL7 REF I12 message with local customization(NZ).
When I tried using the GenericParser, I keep getting Validation exceptions.
For example for the segment below, I keep get the output
ca.uhn.hl7v2.validation.ValidationException: Validation failed:
Primitive value '(08)569-7555' requires to be empty or a US phone
number
PRD|PP|See T Tan^""^""^^""|""^^^^""^New Zealand||(08)569-7555||14134^NZMC
My question is:
Is there a way to avoid the validation by using the conformance class
generator
Is it possible to create own validation classes using
CustomModelClasses?
In either case, is there any example code for that or tutorial example documentation?
If disabling validation altogether is an option for your application, then you can set the validation context to use NoValidation.
See this thread in the hapi developers mailing list: http://sourceforge.net/p/hl7api/mailman/message/31244500/
Here is an example of how to disable validation:
HapiContext context = new DefaultHapiContext();
context.setValidationContext(new NoValidation());
GenericParser parser = context.getGenericParser();
String message = ...
try {
parser.parse(message);
} catch (Exception e) {
e.printStackTrace();
}
If you still require validation, but just want to change the validator for specific rules, then you'll have to create your own implementation of ValidationContext. This would be done by sub classing ca.uhn.hl7v2.validation.builder.support.NoValidationBuilder and overriding the configure method and use this to instantiate an instance of ValidationContextImpl.
For an example of how to implement the configure method in your subclass of NoValidationBuilder, see the source code for ca.uhn.hl7v2.validation.builder.support.DefaultValidationBuilder. This is the default validation context that is generating the error message you're seeing. To make it easier for you, I'm including the class listing here:
public class DefaultValidationBuilder extends DefaultValidationWithoutTNBuilder {
#Override
protected void configure() {
super.configure();
forAllVersions()
.primitive("TN")
.refersToSection("Version 2.4 Section 2.9.45")
.is(emptyOr(usPhoneNumber()));
}
}
Notice this is the implementation of the usPhoneNumber method defined in BuilderSupport:
public Predicate usPhoneNumber() {
return matches("(\\d{1,2} )?(\\(\\d{3}\\))?\\d{3}-\\d{4}(X\\d{1,5})?(B\\d{1,5})?(C.*)?",
"a US phone number");
}

How do I get to use Model1.foo instead of Model1.edmx, and invoke IModelConversionExtension callbacks

I have a VSIX and a associated MEF DLL using IModelConversionExtension Class as per the documentation, and a pkgdef file setting up .foo as an extension to invoke the EF Designer.
[PartCreationPolicy(CreationPolicy.Shared)]
[Export(typeof(IModelConversionExtension))]
[ModelFileExtension(".foo")]
public class MyConversionCallback : IModelConversionExtension
{
public void OnAfterFileLoaded(ModelConversionExtensionContext context)
{
//How does this get called?
return;
}
public void OnBeforeFileSaved(ModelConversionExtensionContext context)
{
//How does this get called?
return;
}
}
[$RootKey$\Editors\{c99aea30-8e36-4515-b76f-496f5a48a6aa}\Extensions]
"foo"=dword:00000032
[$RootKey$\Projects]
[$RootKey$\Projects\{F184B08F-C81C-45F6-A57F-5ABD9991F28F}]
[$RootKey$\Projects\{F184B08F-C81C-45F6-A57F-5ABD9991F28F}\RelatedFiles]
[$RootKey$\Projects\{F184B08F-C81C-45F6-A57F-5ABD9991F28F}\RelatedFiles\.foo]
".diagram"=dword:00000002
[$RootKey$\Projects]
[$RootKey$\Projects\{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}]
[$RootKey$\Projects\{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\RelatedFiles]
[$RootKey$\Projects\{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\RelatedFiles\.foo]
".diagram"=dword:00000002
I can get both the similar Transform and Generation MEF Classes to work fine.
And my Model1.foo does invoke the EF Designer, but
1. OnAfterFileLoaded and OnBeforeFileSaved never fire, and
2. I get an error message when I try to save Model1.foo, which says to see errors in the Error List but there are none.
What am not doing to get this to work.
Thanks
OnAfterFileLoaded is supposed to be invoked if you load a file whose extension is different than edmx and the IEntityDesignerConversionData.FileExtension returns a value that matches your extension. OnBeforeFileSaved works the opposite way - on save. However - I looked at code in this area today and concluded that it actually cannot work. I filed a work item for this: https://entityframework.codeplex.com/workitem/1371