converter

Windows 8 C#: Windows.Ui.Xaml.Media.ImageSource change Image

元气小坏坏 提交于 2020-01-05 05:26:31
问题 WARNING There are two different ImageSource s in Windows API System.Windows.Media.ImageSource = The one of Windows Forms Windows.Ui.Xaml.Media.ImageSource = The one of Windows Store Apps I'm a beginner in C# and Windows 8 Metro Style App programming stuff. But if you want to edit the image of a Image , the "old" method with BitmapImage won't work: XAML: <Image Source="http://image.source.de" x:Name="Image1" /> Code-Behind C#: Image1.Source = new BitmapImage... won't work. The compiler will

Using Converter with image within datagrid

徘徊边缘 提交于 2020-01-04 14:01:45
问题 I'm stumbling on this data converter stuff, especially with relation to multiple rows and dynamically show/hide an image. Lets take a master/detail data perspective. On a given view (presentation), I have header information and a data grid showing a bunch of line items. Before saving the line items, there could be one or more rows having missing/invalid data. I want to display a graphic image to the left of the line item giving the user some visual cue that ...hey, this row needs to be fixed.

Injecting a managedBean in a converter [duplicate]

牧云@^-^@ 提交于 2020-01-04 08:03:34
问题 This question already has answers here : How to inject @EJB, @PersistenceContext, @Inject, @Autowired, etc in @FacesConverter? (5 answers) Closed 3 years ago . I'm trying to write a converter for my selectonemenu list so the list that i want to display can be retrieved from a managedBean's getter getDatasetList() . My managedBean is viewScoped. here's the code of the converter: @FacesConverter(value = "datasetConverter") public class DatasetConverter implements Converter{ @ManagedProperty

Java: convert floating point binary to floating point decimal

你离开我真会死。 提交于 2020-01-04 07:27:07
问题 I want to convert a string representing the mantissa portion of a IEEE754 double. Cannot find if there is such a conversion method in Java, in order to avoid manually adding 1 + 1/2 + 1/4 + 1/8 etc. |0100000011001010000111110000000000000000000000000000000000000000 --> 13374 in IEEE754 |------------1010000111110000000000000000000000000000000000000000 --> mantissa part | 1.1010000111110000000000000000000000000000000000000000 --> restoring fixed value 1 String s = "1

can currencyconverter ignore the $ sign when not entered

我怕爱的太早我们不能终老 提交于 2020-01-04 04:05:53
问题 In a datatable, I have to validate the input as currency. When I enter the value after deleting the $ sign, the input component throws an error. <p:column> <f:facet name="header"> <p:outputLabel value="REC REVENUE" /> </f:facet> <p:inputText id="RERVN" styleClass="RERVN" value="#{segmentSetup.userSegmentTypesMap['RERVN'].segmentValues[rank].rangeMinValue}" disabled="#{!segmentSetup.userSegmentTypesMap['RERVN'].selected || (rank==fn:length(segmentSetup.ranks)) }" validator="#{segmentSetup

Where to set the Converter for items of a collection in XAML

我怕爱的太早我们不能终老 提交于 2020-01-04 03:55:08
问题 I just made my first converter to convert from int to string. I have a combobox fill with integers(years) but if the value is 0 I want the combobox to show 'All'. This is my converter: public class IntToString : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null) { int intY = (int)value; if (intY == 0) { String strY = "All"; return strY; } else { return intY.ToString(); } } return String.Empty; } public object

Manage the targetType of a Binding in a MultiBinding

匆匆过客 提交于 2020-01-04 01:20:10
问题 So, I have a multi-binding with a converter that takes in some values and finds the max of them. The problem is that one of the bindings utilises a converter that expects a double target type, while the binding has an object target type. I was wondering if there was any way to modify the target type of a binding in any way. Below is an approximation of my xaml: <TextBlock> <TextBlock.Width> <MultiBinding Converter="{StaticResource _maxValueConverter}"> <Binding Source="{StaticResource

What has happened to MultiBinding between .NET 3.5 and .NET 4.5?

我只是一个虾纸丫 提交于 2020-01-03 15:22:54
问题 We are currently in the process of converting a project from version 3.5 to version 4.5 of .NET. We set a text box IsEnabled flagged using a multi binding with a multi binding converter. Each of the bindings has their own converter. All worked well in .NET 3.5 but in .NET 4.5 the target type that is passed to the child converter is of type object instead of bool. Is this a known issue? has MS refactored the multi binding to not pass the target type to child converters. I created a simplified

GLIBCXX_3.4.9 not found ubuntu

橙三吉。 提交于 2020-01-03 05:51:26
问题 i am trying to convert .doc file to .html file using shell_exec command php.. for this i have written the below code: $result = shell_exec("soffice --headless --convert-to html /opt/lampp/htdocs/converter/public/uploads/resume/".$filename." 2>&1"); echo $result; but i am getting this when i run the project from the browser: /usr/lib/libreoffice/program/oosplash: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /usr/lib/libreoffice/program/../ure-link/lib/libuno

C++ Convert Sytem::String^ to LPCOLESTR

社会主义新天地 提交于 2020-01-03 04:53:08
问题 I write in mixed mode (C++/CLI) and I can not resolve this problem: String ^progID = "Matrikon.OPC.Server"; CLSID clsid; HRESULT result = CLSIDFromProgID(progID, &clsid); error C2664: 'CLSIDFromProgID' : cannot convert parameter 1 from 'System::String ^' to 'LPCOLESTR' How can I convert String^ to LPCOLESTR ? Thanks! 回答1: First, lets convert System::String to char* IntPtr p = Marshal::StringToHGlobalAnsi(progID); char *pNewCharStr = static_cast<char*>(p.ToPointer()); second, casting char * to