Questions tagged [xaml]

17793 questions
1

votes
1

answer
904

Views

Button's ControlTemplate's ContentPresenter's Textblock's Foreground not changing

I have tried the following... Setting the button's TextBlock.Foreground. Setting the contentpresenter's TextBlock.Foreground. Setting the IsMouseOver Trigger as it is shown here. Setting the IsMouseOver Trigger without a target name (assuming it hits the button). Everywhere I have tried TextBlock.Fo...
Price Jones
1

votes
1

answer
950

Views

BringToFront / SetZIndex in Universal Windows App

Apparently Grid.SetZIndex() doesn't exist . As doesn't ctrl.SetValue(Grid.ZIndexProperty…). So how do I bring a Child of Grid to Front?
ispiro
1

votes
1

answer
208

Views

How to get the value of an attached property in code?

I have a button with a ToolTipService.ToolTip in it. How do I access it in code? e.g. Test
ispiro
1

votes
2

answer
63

Views

Change Trigger order in BasedOn / inherited Style

I have a base Style - DataGridRowSelectionStyle. On some DataGrids I need to extend this Style to ink the background. DataGridRowSelectionStyle RowStyle Because of the Trigger order, the two base Triggers are overwritten and IsMouseOver or IsSelected is not triggered anymore. Solution 1: Extend the...
Dominic Jonas
1

votes
0

answer
6

Views

uwp how to resize items in a templated item source all at once?

I have this listview and I want to dynamically resize the item's properties (fontsize, width and height etc..) upon a window's size change. So far I've been able to do so by modifying item source's elements' layout one by one in c# (with a for loop). As the listview items' count grows, the effect be...
VD26
0

votes
1

answer
13

Views

WPF make container background not wash out the contents of children

Simple code: I have various child controls that display states. When any of these children are in a error state, I want the background of the of the container to change color. e.g..e. if one of the children is in an error state, the background should be red. However if I set the container background...
CaptainMuffin
3

votes
1

answer
96

Views

How to drag elements out of a scrollable ListView using touch, without having to hold on the element [UWP]

As it stands, the functionality to drag an element out of a ListView means that the user will have to long press or 'hold' on the element in order to activate the drag functionality of the element. The problem is that our live testing has indicated that this is far from intuitive for the end user. I...
Adam McMahon
1

votes
1

answer
29

Views

How create shared style for path control in UWP?

I have next XAML code: And style in Styles.xaml: Problem: style used only one time. Second path control don't had Data from style, and in designer (and execution too) it look like this.
0

votes
1

answer
14

Views

Access DataGrid.RowStyle in AttachedProperty

XAML: ... AttachedProperty: private static void CanExportToExcelChanged( DependencyObject d, DependencyPropertyChangedEventArgs e) { //Just my way of secure casting DependencyObject -> DataGrid if(d is DataGrid dataGrid) { Debug.Assert(dataGrid.RowStyle != null, 'Why is this null?'); } } Problem: A...
Felix D.
0

votes
0

answer
4

Views

Editable Grouped ListView in Xamarin Forms

I Would like to display something like nested listview in Xamarin forms. I mean i would like to have list of Person with theirs orders (the list of order could be empty). The List would allow to add order to specific person, remove person (and all of his orders), and remove specific order. I Conside...
Bartek Chyży
1

votes
1

answer
1.4k

Views

Error: This PlotModel is already in use by some other PlotView control

I have two tabs that is bind to one viewmodel which contain a PlotModel of oxyplot and view model selected through a DataTemplate. When click on the first tab the viewmodel was bind properly but when switch to second tab above exception defined in title throw. All of control is same in two tab. Is i...
Alireza
1

votes
2

answer
72

Views

Changing background color of the row in a grid

I'm working on a C#/WPF application.In one of the xaml screens, I've a MS windows datagrid and I'm binding my custom listview collection to it. This listview collection(i.e. MyCollection) contains prices for various products.The collection is of type MyProduct: public class MyProduct { public Int32...
Vineet v
0

votes
0

answer
5

Views

AbsoluteLayout with proportional height and with minimum and maximum heights

We need a banner, called bannerView in the code bellow, to shrink or expand according to the device height. However this banner height: cannot be smaller than 60 pixels cannot be bigger than 146 pixels code: Note: We need the outer AbsoluteLayout to add a gradient effect on the screen
1

votes
2

answer
1k

Views

Can I apply a WPF style to an element only in a certain layout?

I have a TextBlock style like this: I use it in Grid based forms, e.g: Now instead of repeating the style name on every TextBlock in the grid, I would prefer to e.g. have a Grid style like: ... Then I would, if possible, like to modify my TextBlock style to only apply to that element when it is a ch...
ProfK
1

votes
2

answer
1.4k

Views

Read the SMS activation code automatically in Xamarin Forms instead of manually typing it by user

I wrote a project with Xamarin Forms. When every user has signed up, I send him/her an activation Code to confirm it and the user has to insert it to enter the app. But I am looking for a plugin or a way that the user does not need to insert the activation Code. I want the activation Code to be read...
Narges MirZamani
1

votes
2

answer
867

Views

Disable selecting Items in ListView

For a Social Networking app I am working on I am trying to display comments with a ListView but I do not want it to be highlighted when clicked. I tried using `((ListView)sender).SelectedItem = null;` in a selected event but that still shows it being selected for a second. I need it to never show....
Dan
1

votes
1

answer
289

Views

How to play video and audio from separate URLs in UWP app?

I'm trying to create a video player for a UWP Desktop App. I not able to play a video and audio from different URLs. I have given my code below but I haven't given audio and video URLs. I'm using a Xampp local server for my case. Please Help Me. My MainPage.xaml.cs: namespace my_video_player { publi...
Aman
1

votes
2

answer
702

Views

XAML: Toggleswitch reset state

I want to perform the following. I have a ToggleSwitch whichs Toggled event handler performs some action. If this action fails I want to reset the ToggleSwitch's state to what it was. I achieve this by doing: toggleSwitch.IsOn = !toggleSwitch.IsOn; My problem is that this again raises the Toggled e...
Rasetech
1

votes
2

answer
1.9k

Views

How to use bound XAML property in UserControl?

I have my own UserControl and I'm binding myString to it. Now I want to use it in my UserControl. I have DependencyProperty defined in my UserControl: public string MyProperty { get { return (string)GetValue(MyPropertyProperty); } set { Debug.WriteLine(value);//writes nothing, null SetValue(MyPrope...
Macko
1

votes
3

answer
1k

Views

UserControl with custom ItemsSource doesn't detect changes

I have simple UserControl where is defined property ItemsSource public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register('ItemsSource', typeof(Dictionary), typeof(UserControl1), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(UserControl1.OnItemsSou...
demo
1

votes
1

answer
95

Views

C# - text to double conversion throws System.TypeInitializationException

So I have 2 classes, one called DataTypes.cs and one called Doelen.xaml.cs code DataTypes.cs: //Doelen public static double Omzet = 0; public static double Marge = 0; public static double NieuweKlanten = 0; //capaciteit public static double cUurPWeek = 0; public static double cUurPWeekSF = 0; public...
1

votes
1

answer
63

Views

style Items in ListView

I am trying to set a list of Items in my View,like that: but the problem is that I get this instead: this is my code: How can I put a border thickness in each listview Item and the click.png item to the Left.Can you help me please to fix my view to be like the original thanks for help:
hanali
1

votes
2

answer
722

Views

SQLite Sum Column based on Date Range

Good evening, I have the following table public class SalesRecord { [PrimaryKey, AutoIncrement] public int SalesRecID { get; set; } [Indexed] public string SalesRecDate { get; set; } public string SalesRecCustName { get; set; } public string SalesRecProdName { get; set; } public int SalesRecProdQty...
Shycs
1

votes
1

answer
366

Views

Why is Visual Studio 2015 not recognizing my Windows 10?

I am using Visual Studio 2015 community edition and recently updated it with the windows SDK for creating universal windows application. However whenever I try to create an app, it doesn't load the xaml designer and it gives a notification that I have to install windows 10 to use the xaml designer....
Shivam Shekhar
1

votes
2

answer
1.6k

Views

wpf datagrid not showing data, but show rows

I'm trying to make a simple WPF project and I have a problem: the DataGrid is bound to an ObservableCollection, it does not show the data, but it shows the correct amount of rows.Here's how it looks Here's XAML: Add an element Delete old files Show most popular element And here's the code: public p...
small-j
1

votes
1

answer
1.2k

Views

UWP - PivotItem mouse over change color

I want to change the Forground color of a PivotItem Header when Mouse is Over with UWP,I work with windows 10 I tried this code: ..... I have an error 'The attachable property 'Triggers' was not found in in type 'ControlTemplate' have you please any idea how can I change the color of an image when t...
user3821206
1

votes
1

answer
671

Views

Styling Custom User Control Disabled state

How can I style the 'disabled' state of my custom user control? I'm not clear on how to style the various parts of my custom user control. For example my custom user control is made up of several components. So How can I target specific parts of the control in my global style sheet? Keeping in mind...
JokerMartini
1

votes
2

answer
3.8k

Views

Binding Image element to a property in uwp

I have an image element in xaml and I want to bind it with a property in my view model. I have a binding of xaml Image element to a property called MainImage as shown below. private Image mainImage_ = new Image(); public Image MainImage { get { return mainImage_; } set { if (mainImage_ != value) { m...
Umair Jameel
1

votes
1

answer
515

Views

Apply DataTrigger Setter only if the element is visible

I have two text boxes, combo box, and a save button. If user selects specific value of the combo box second text box becomes visible. I have validation rule that checks if the text box is empty or white space and if it is, it disabled the save button. So right now, no matter if the second text box i...
Mefhisto1
1

votes
1

answer
150

Views

2 different stackpanels in a BottomAppBar Universal App

I am trying to put the elements in my BottomAppBar like that: with this code I get the two stackpanels in the left,can you correct please my code: thanks for help :)
user3821206
1

votes
2

answer
486

Views

Binding to a textbox throws bind exception error

I'm trying to bind a textbox to a public string field to filter a list of items in the wpf listbox. I keep getting this error. It's rather simple setup. The code is below. I feel that the code itself is rather simple and I'm not clear as to where the problem is. Help is appreciated! For some reason...
JokerMartini
1

votes
2

answer
723

Views

WPF DataGrid change Cell background if the cell contains a specific value

Consider the following XML code. what i really want to do is that if the cells of my data grid contains a specific value for example if some of my data grid cells contains the value '1' i want those cells to be colored Light Green no matter where ever the cell location is. Currently i am trying to d...
Vishnu Babu
1

votes
2

answer
911

Views

relative panel / grid cannot align the horizontal alignment in item template selector

I am working on a chat application. The chat page consists of a itemTemplateSelector which aligns the text to right end/left end according to the sender by checking a bool value. here is the code ItemTemplateSelecter: public class ChatTemplateSelector : DataTemplateSelector { public DataTemplate Lef...
KartheekJ
1

votes
1

answer
393

Views

Adaptive trigger in a Scrollviewer does not work

I use an Adaptive trigger to fit the content of my UWP Application to the window size. If the window witdh is smaller than 1000px, all of the three rectangles will be stacked. If not, the first two rectangles will be side by side and the third one will fill the whole window width beneath the two fir...
User95
1

votes
1

answer
3.7k

Views

WPF datagrid automatic sorting by chosen column

currently I am working on WPF's datagrid. I got an issue with automatic sorting. Here is my xaml: ... ... The problem is: when I update my datagrid's ItemsSource, the datagrid is sorted by ID column, not DueDate as desirable. How to implement autosorting by DueDate when any update action on my datag...
Marcin Zdunek
1

votes
2

answer
142

Views

How to set items on left and right with grid column in windows phone 8.0

Can anyone say how to do like that: In a pop-up I have two items one textblock and one image, in function of size of text I need to put all times text on left and icon right, like in the second picture. First Image is like that when first column is set auto: When set an static width: After set I wa...
Ciprian Jijie
1

votes
1

answer
295

Views

NullReferenceException occurs when to use the XAML designer

After updating to the latest version of visual studio 2015, I am unable to use the XAML designer due to the fact that each time I attempt to open it a screen appears to inform me that a NullReferenceException has occurred. I have tried the solution detailed in the post below, However, as I am not a...
Tom Easterbrook
1

votes
2

answer
163

Views

circular border over image is not uniform

I am trying to show an image with circular border of some color for windows phone 8.1 silverlight project, however when applying the clip to it, the image overlaps on the edges of the border, is there any way to achieve a uniform border over the image? using the below xaml template Here is my xaml...
abhishek saatal
1

votes
2

answer
212

Views

WPF Progressbar won't left align properly

i have the following XAML code to display a set of controls in my window: Its basically an Image to the left and two TextBlocks and a ProgressBar to the right. My problem is that the ProgressBar at the end will stretch infinitely wide when my window gets wider. I want my progressbar to stop growing...
sebingel
1

votes
2

answer
91

Views

wpf shape doesn't stay on top using index

I've attempted to use the index to set the red ellipse on top of the blue background but no matter what i changed it didn't affect its placement. How can i make it so the red dots appear in-front/on-top of the blue rectangle?
JokerMartini

View additional questions