How to enable or disable the buttons in windows phone 7? - windows-phone-7.1

My Design has the following lines of code:
<Button BorderThickness="0" Content="Done" FontSize="21.333" Height="65" Margin="334,13,6,0" VerticalAlignment="Top" FontFamily="Times New Roman" Name="btnConvert" >
<Button.Background>
<ImageBrush ImageSource="Images/button_back2.png" />
</Button.Background>
</Button>
My code goes btnConvert.IsEnabled = false;.
It can't disable the button. Instead, it hides the button. I need that button to be visible but disabled. Please help me.

Isenabled works for me. try your xaml code in some xaml viewer to check if you are not doing anything wrong

This is what I usually do:
`btnConvert.IsHitTestVisible = false;`
It will disable the button, but you can see the button with the same colors at beginning.

Related

.Net MAUI - Shell Navigation Back Button Title (iOS)

I have noticed one issue in Shell Navigation title. When setting ContentPage's Title property it shows same text with Back button also. Used NavigationPage.BackButtonTitle property as well from xaml still its not working.
For Example:
HomePage.xaml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Switch_Bug.HomePage"
NavigationPage.BackButtonTitle="Back"
Title="Home Page">
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>
Result:
Expected result:
In iOS, it should Back Button text as "Back" otherwise just show the back button. But it shows the page's title text.
Update 02/02/2023
The main issue is if the title of the page is short then it will show the same with the back button and if the title is long enough then it will work fine.
The same issue was reported on the MAUI git repo as well. https://github.com/dotnet/maui/issues/11691
First of all, I believe BackButtonTitle will only work for iOS since Android does not use "back titles"
Second, the BackButtonTitle might be slightly counterintuitive, but it is the title that will be displayed on a further page that navigates back to the page you defined in on. In your case, setting the BackButtonTitle on your HomePage to "back" does not set the back button on the HomePage to "back"; it will set the back button to "back" on any page that has a back navigation to the HomePage. Hope that makes sense.
NavigationPage.BackButtonTitle is applicable to Navigation.PushAsync in NavigationPage, but not in Shell. There is a corresponding method in Shell’s navigation to change the text of the back button. I did a simple test, and you can modify your code as follows:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Switch_Bug.HomePage"
Title="Home Page">
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
<Shell.BackButtonBehavior>
<BackButtonBehavior TextOverride="Back" />
</Shell.BackButtonBehavior>
</ContentPage>
For more details, you can refer to the official documentation:.NET MAUI Shell navigation

<ion-input> (click) opens keyboard instead of Modal

I have the following code in my html.
<ion-item (click)="showAddressModal()">
<ion-input [(ngModel)]="address.formattedAddress"
type="text" placeholder="Pick a location for your event">
</ion-input>
</ion-item>
showAddressModal() essentially opens a modal page where the user can search for an address.
Works like charm when I run it on chrome with ionic cordova run browser.
On ioS, however, it takes 2, sometimes 3 clicks to open the modal. First click brings the keyboard up. If I disable the keyboard by using [readonly]="true" on then the keyboard doesn't come up, but I still need 2 clicks. If I disable the entire input using [disabled], it doesn't serve my purpose - cannot click. I have tried moving the (click) from ion-item to ion-input, I have tried removing ion-item altogether, no avail!
Please share your perspective on how I can fix this.
Regards,
J
OK. For now, I've fixed my own problem by removing ion-input altogether and just using ion-text with a (click) listener on it. In lieu of the placeholder, I just show the same placeholder if address.formattedAddress is empty.
Still not sure where the problem is with ion-input and iOS, but will save that problem solving for another day.
For those of you, curious to see the new code, here's what the template code looks like - no change to my component or to the modal itself -
<ion-item (click)="showAddressModal()">
<ion-text inputmode="none">
{{ (address.formattedAddress == "") ? "Pick a location for your event" : address.formattedAddress}}
</ion-text>
</ion-item>
Thanks!

WiX/Msi textbox border covered up by background image if text is too long

I have an edit control on my custom dialog, that defaults to a session property SERVICE_URL.
<Control Id="serviceUrlTextBox" Type="Edit" X="135" Y="45" Height="17" Width="215" Property="SERVICE_URL" />
If the text fits the textbox, everything looks alright, if the text is too long however, the border goes missing. If the user adds/removes text (once the dialog is shown), that doesn't change the appearance, only the initial length has an effect.
Using Multiline="yes" does not help, the text is never wrapped and there is no border either.
How can I keep the border even if the text is too long? I'm using WiX Toolset v3.8.
EDIT: The background plays a role, as Buzka suggested (notice the background "crowding in" when the text is too long). Clearly a bug. Any ideas how I can get it to work short of removing the background?
That's how I have created the different background:
<Binary Id="dialogBackground" SourceFile="Resources\WixUIDialogBackground.png"/>
<Control Id="background" Type="Bitmap" Text="dialogBackground" Width="370" Height="243" X="0" Y="53" TabSkip="no" />
<Control Id="explanationLabel" X="135" Y="23" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="215" Height="100" Text="Please provide the URL of the SettingsService. If you prefer, you may change it at a later stage in the Settings." />
<Control Id="serviceUrlTextBox" Type="Edit" X="135" Y="45" Height="17" Width="215" Property="SERVICE_URL" />
I'm using v3.8 too, don't have that problem in my installer. I can see you use custom background color, maybe thats reason?
#Edit
I mean maybe you should set custom border to textbox too? Or try with default backgroud color.
#Edit
After LOOOOONG searching... i found something like this:
Unfortunately, that's how MSI draws it. There's no concept of a custom
control in MSI UI, so there's nothing WiX can do to fix it.
So i think my answer was good, no chances to change it, cause it's not supported.

Jquery mobile radio button not always setting the underlying input on click

I have a jqm radio button that looks like this:
<div data-role="controlgroup" data-type="horizontal">
<h3>Type</h3>
<input type="radio" name="type" id="deposit_typeTotal" value="t" checked/>
<label for="deposit_typeTotal">Total</label>
<input type="radio" name="type" id="deposit_typeIndividual" value="i"/>
<label for="deposit_typeIndividual">Individual</label>
</div>
It's part of a phonegap application which I'm currently testing on an android galaxy s2, which is where I'm seeing the problem. I've never been able to get it to break in Google Chrome on the desktop.
I have an click event attached to this button which calls a function which does various things, but I've modified it to alter the title to the value of the button to aid my debugging.
var type = $("#deposit input[name=type]:checked").val(); // Gets the value of the checked button
app.count++;$(".depositOrPayment").html(app.count+"/"+type); // Sets the title of the page
So what I'm seeing is the number of times the function has been called / t or i depending on which button I click. However, sometimes (particularly if I click the buttons quickly) I get undefined as the button's value. Once this happens, it stays as undefined no matter how many clicks I do.
Anybody got any ideas?
Cheers
Graham
There is a difference between click and tap. A tap has about a 300ms delay (around that). Anyway, you can also bind to the tap & click event in JQM (virtual mouse events).
$('#element').on('tap', function() {
...
});
or
$('#element').on('click tap', function() {
...
});
Read this: http://phonegap-tips.com/articles/fast-touch-event-handling-eliminate-click-delay.html
So there is FastClick https://github.com/ftlabs/fastclick
Check this out What is the difference between the click and tap events?
And this http://phonegap-tips.com/articles/fast-touch-event-handling-eliminate-click-delay.html
EDIT: I made this a wiki in the hopes that someone can answer it better than me :)

XUL Textbox inside Popup not working

I am working on creating a Firefox extension. I have added a textbox inside a popup. The popup opens on clicking on a toolbar button. The textbox is appearing but does not let me edit it. I have not given any read only attributes.
Here is the code:
<popupset id="myPopupSet">
<popup id="trial-popup" noautohide="true" position="after_start">
<vbox>
<label value="Enter your name:"/>
<textbox id="identfier_box" value="This is some text."/>
</vbox>
</popup>
</popupset>
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="mybutton"
class="toolbarbutton-1"
label="Identifier"
popup="trial-popup"
insertbefore="urlbar-container" />
can anyone let me know why there is this problem?
Thanks!
What you really want is a panel and not a popup.
Change <popup> to <panel> and you have what you want.

Resources