How to make Binding
Hi,
How to make binding for newely created methods.From Task -> Method.
For me the Binding icon is not activated.can i know the solution.
Please givfe the solution ASAP.
hi,
PFTC, use TS as type and type in the task number.
Now click change.
There you'll see description, text and objectmethod.
type in the objecttype and the method and press enter. Now notice the green icon somewhere below the text method. this is the binding button.
This is also accessible via the menu: path goto>binding>object method
Kind regards, Rob Dielemans
Similar Messages
-
How to make BPEL process to be exposed via java binding?
How to make a BPEL process itself to be exposed via java binding?
You can using WSIF. There are a few doc on the internet that explain this here are a few to get you started.
http://www.oracle.com/technology/pub/articles/bpel_cookbook/juric.html
http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/java.htm
cheers
James -
How to make a mac managed in wgm
Could anyone point me in the direction of a how to make a mac managed in workgroup manager, ive done it before, but i cant remember how to do it, all i can remember was that once the mac was managed it had a $ after it, then WGM can manage that macs preferences.
Thanks
RobHi John
I think im trying to do something different, to enable WGM to control clients macs preferences, i had to add a computer to workgroup manager in accounts/computer tab, when the computer was correctly bound (or binded) it looks like my picture, with a $ at the end of it, im trying to add new computers to this list, i just cant remember how to do it, like i say i could have done it through open directory utility. -
How to make a round Slider with an image ?
hello everybody,
I'm back and i have a new question : how to make a round Slider (like a volume knob) with an image ?
I see this very interisting tutorial : http://fxexperience.com/2012/01/fun-javafx-2-0-audio-player/ but it use a private class from com.sun.javafx.scene.control.skin.SkinBase...
thank you for your answer.
Gaëtan.I'm guessing you could subclass Slider to create a class SliderKnob.
At some stage in the process, not sure where (perhaps after calling super in the constructor), you could look up the slider region's child thumbnail and track and call setVisible(false) and setManaged(false) on them, create an ImageView for your knob, add the knob ImageView to the slider's region and bind the ImageView's rotateProperty to the slider's valueProperty(). Not sure that that is any better than using the SkinBase stuff, but at least it is an alternative idea.
Everything to create your own controls has not been added to the public API, so if you want to make your own controls in the same way the JavaFX does them (i.e. with Skin's and Behaviours and stuff like that) you have to make use of com.sun classes unless you can subclass and modify the workings of existing controls similar to what is proposed in the preceding paragraph. -
How to make serializable object in webdynpro?
Hi
I have written the following code... when i am executing i am getting the following error..........
<b>javax.xml.rpc.soap.SOAPFaultException: Deserialisation failed</b>
I think is it becoz of data... how to make it serializable
Request_Z_BAPI_CUSTOMER_CHANGE_WS_customerChangeFromData customer = new Request_Z_BAPI_CUSTOMER_CHANGE_WS_customerChangeFromData();
ComplexType_CustomerChangeFromData complexType = new ComplexType_CustomerChangeFromData();
ComplexType_Bapikna101 bapi = new ComplexType_Bapikna101();
Bapikna101 bapi1 = new Bapikna101();
bapi1.setCity("RIYAD");
bapi1.setCountraiso("SA");
bapi1.setCountrniso("SA");
bapi1.setCountry("SA");
bapi1.setCountryiso("SA");
bapi1.setFaxNumber("12345678");
bapi1.setFirstName("First Name");
bapi1.setInternet("[email protected]");
bapi1.setDateBirth("12.12.2006");
bapi1.setLanguIso("EN");
bapi1.setName("Name");
bapi1.setName3("Name 3");
bapi1.setName4("Name 4");
bapi1.setRegion("GB");
bapi1.setFormOfAd("Address");
bapi1.setStreet("Street");
bapi1.setPostlCode("12345");
bapi1.setLangu("X");
bapi1.setTelephone("12345678");
bapi1.setTelephone2("12345678");
bapi1.setCurrency("INR");
bapi1.setCurrencyIso("INR");
bapi1.setOnlyChangeComaddress("X");
complexType.setCustomerNo("0000040009");
complexType.setPiDistrChan("01");
complexType.setPiDivision("01");
complexType.setPiSalesorg("QNIN");
customer._setUser("abap");
customer._setPassword("quinnox");
CustomerChangeFromData data = new CustomerChangeFromData();
data.setPiAddress(bapi1);
//bapi.setOriginalBean(bapi1);
complexType.setOriginalBean(data);
wdComponentAPI.getMessageManager().reportSuccess(" "+complexType.getOriginalBean().getCustomerNo());
wdComponentAPI.getMessageManager().reportSuccess(" "+complexType.getPiAddress());
wdContext.nodeRequest_Z_Bapi_Customer_Change().bind(customer);
complexType.setPiAddress(bapi);
wdComponentAPI.getMessageManager().reportSuccess(" "+data.getPiAddress().getCity());
customer.setParameters(complexType);
help me
Best Regards
Ravi Shankar BHi ashuthosh,
What is the structure of your import and Export parameters of your RFC.
There are 2 ways to acheive it.
In the RFC either
1. Use a Table parameter
2. Use a Export Structure
If you use a Table parameter in your RFC then in your webdynpro when you import your adaptive RFC model you would get the Table as a class.
Assume your RFC/BAPI is called "Bapi_RFC_Insert"
write the code
Bapi_RFC_Insert in = new Bapi_RFC_Insert();
wdContext.nodeBAPI_RFC_Insert_InputElement().bind(in);
<TableName> <someName> = new <TableName>
<someName>.setTabValue1();
<someName>.setTabValue2();
in.add<>(<someName>);
This should pass values as a batch.
You can also do this using Export parameters. But a table is much better.
Let me know if you require more information.
regards
ravi -
Hi all,
I want a column to have checkboxes in my table where user can select at runtime.
I added one colum to my table with Checkboxes.But the checkboxes are comming in non Editable mode.
How to make them editable???
My context structure is already binded to my table..now i added one ValueNode with One attribute and i binded that texts property of checkbox to the Valueattribute
The cardinality of my ValueNode is 1..1 and selection is 0..1
Regards
Chandrashekar.Hi,
when you added the checkbox as cell editor, then go to it's property:
set "enable" as true.
set "readonly" as false.
and create a boolean attribute "checked" in the table bode and bind it to the check box value property.
And in the onAction of checkbox wirte the code to select or deselect the checkbox.
and set the value as follows:
wdcontext.nodeTable().getcurrentElement().setAttribuiteValue("checked", true);
Regards,
Praveen -
How to make the print, email button work in PDF output
Hello,
I'm using LC Designer ES2 to create a xdp form with print, email and httpSubmit button. Then using LC server to generatePDF output, binding with xml dynamically. But after that I got the static pdf file and none of the button work,
I really need help on how to make it work. Any configuration, plug-in....
Thanks,Hi,
This is solved by note 1281208.
Thanks,
Edited by: Zhijie Kong on May 24, 2011 6:06 PM -
How to make a SELECT LIST READONLY
Hi,
I have a form to update the existing values in a table. Primary column is based on a Select List.
So when user goto update screen they SHOULD NOT BE ABLE TO CHANGE the primary filed(means the value display in the Select List).
SO to make this one I have make that select list read only. But not like other items even when we make select list read only it still allow user to change the value. So basically read only property not working for select text.
There are many post in this regading same issue. Some of them recomended to make it disabled. But when we make a item disabled then when user POST that form, Apex not POST any disabled item values. Basically disabled items values not passing next form. So making item dissable also not a solution.
I have read almost 20 post in here regarrding this and didnt get any solution for this. So please let me know if anyone knows how to make a select list read only (which is working same as read only text boxes, means that value pass when user POST the form).
Thanks in advance...
mcYou define a function(this is based aorund jQuery selectors) in the page header like
<script>
var makereadonly = function(selector, makeReadonly) {
$(selector).filter("select").each(function(i){
var select = $(this);
//remove any existing readonly handler
if(this.readonlyFn) select.unbind("change", this.readonlyFn);
if(this.readonlyIndex) this.readonlyIndex = null;
if(makeReadonly) {
this.readonlyIndex = this.selectedIndex;
$(this).css('background-color','#CDCDCD'); //Adds a background colour to readonly item
this.readonlyFn = function(){
this.selectedIndex = this.readonlyIndex;
select.bind("change", this.readonlyFn);
//For input items
$(selector).filter("input,textarea").attr('readOnly','readOnly');
$(selector).filter("input,textarea").css('background-color','#CDCDCD');
</script>and apply it using a jQuery selector (call it in the "execute on page load" or any other JS code)
makereadonly('#ITEMNAME1,#ITEMNAME2,#ITEMNAME3',true);Not that all of these methods(that act at the client side) will only prevent the user from modifying it 'normally', they could manipulate these readonly items using Javascript(or using firebug or any tool like that). So its better to make sure that your don't use the item value(from the page) for processing. -
How to make HtmlSelectManyCheckBox scrollable
Hi,
I have a requirement like , have to create the checkbox list dynamically.
I am doing it through the binding. But i want to make the HtmlSelectManyCheckBox should be scrollable.
I am doing as belwo
HtmlPanelGrid innerGrid = new HtmlPanelGrid();
innerGrid.setWidth("150%");
innerGrid.setStyle("height:150px; border:2px; overflow-x: scroll; overflow-y: scroll;");
HtmlSelectManyCheckbox selectBox = new HtmlSelectManyCheckbox();
selectBox.setBorder(3);
selectBox.setLayout("pageDirection");
selectBox.setStyleClass("selectManyCheckbox");
selectBox.setTitle(catVO.getCatName());
// adding the selectitems to select many list box
UISelectItems items = new UISelectItems();
items.setValue(catVO.getInterestItems());
selectBox.getChildren().add(items);
innerGrid.getChildren.add(selectBox);Though i set the style of the grid to be scrollable , but its not working properly.
Plz help me , how to make it scrollable.hari_honey wrote:
Thank u , ok how to apply the styles or style class to the HtmlPanelGroup.Uh, just the same way.
And i have to create the lists dynamically , and i dont have the count of the number of panelGroups.You already have the count of checkboxes.
How can i put them in table.The same way. -
How to make a call to service from site studio templates?
Hi,
May be this is very basic but I am not able to figure out how to make a call to a service from site studio templates (hcsp). I have seen one example of service call in the dynamic list fragment. It makes a call to SS_GET_SEARCH_RESULTS service using executeService() method. But it doesn't take any parameters and also not very how returned results are captured.
I want to execute WCM_PLACEHOLDER service. It takes 2 main parameters dataFileDocName and templateDocName. The returned result is typically a html response.
The service typically is executed using http request and the url would be something like this
http://hd-pratapm/ucm/idcplg?IdcService=WCM_PLACEHOLDER&dataFileDocName=VIRTUSAINC&templateDocName=DETAILS_REGION_TEMPLATE
I think SS_GET_SEARCH_RESULTS service works in the similar fashion. I want to execute WCM_PLACEHOLDER service too using executeService() method. How to work with this? How can we pass parameters and capture returned results?
Regards,
PratapHey Pratap,
If you are on a standard Site Studio template (page or subtemplate) you should be able to call the wcmPlaceholder idoc function directly. In fact calling the idoc function provides a lot more functionality then the service call (they locked down a few things in the service call since it is designed to be called from an external application).
The idoc call would look something like: <!--$wcmPlaceholder("Sales", "placeholderDefinitionDocName=placedef_salescontact")--> (taken from page 208 in this doc: http://download.oracle.com/docs/cd/E10316_01/SiteStudio/10gr4/Pdf/Site_Studio_10gR4_Designer_Guide.pdf)
As a general note when you are in idoc script and want to execute a service you call <$executeService()$> as you saw in the dynamic list. The parameters that the service runs on are in the data binder of the current request. To set parameters for an execute service you simply set idoc variables on the page before it. Example:
<!--$QueryText="dDocType <matches> `Document`" -->
<!--$executeService("GET_SEARCH_RESULTS")-->
As for the response when you execute an idoc function, like wcmPlaceholder, that returns a String the response is immediately output to the page in the location you called the function. This would be similar in concept to a jsp scriptlet that outputs a string <%=myResponseString%>
Hope that helps,
Andy Weaver - Senior Software Consultant
Fishbowl Solutions < http://www.fishbowlsolutions.com?WT.mc_id=L_Oracle_Consulting_amw_OTN_ECM >
Edited by: Andy Weaver on Jul 7, 2010 7:59 AM
Added response detail. -
How to make table as "editable false"
Dear Forum,
i am user of jDeveloper jClient/Swing .jpr.
cutomer table having following attributes-
1.cust_id (primary key)
2.cust_name
3.cust_add
Suppose customerview bind with jTable1.
Using ViewObjectEditor, i set "updateable never" for all fields.
This show error, when data insert into table " cust_id as
read only".
Help me, Using jClient Binding how to make Table as "editable false".Overriding method prepareEditor() for new table:
private JTable tableList = new JTable(){
public Component prepareEditor(TableCellEditor editor, int row, int column) {
// 1 and 2 column is not editable
if(column == 0 || column == 1){ return null; }
return super.prepareEditor(editor, row, column); -
How to make group visble and hidden
I have to make one group(which consists of some field) visible and hidden on tableselect. Initially that group should not visible and after selecting table those group need to show. How to make it during runtime..Right now i made the table leadselect -1 so it is not selected. So how to make it hidden.
Thnaks
NityaUse a calculated attribute (read-only, type=Visibility) and implement the get-method like
WDVisibility getGroupVisibility(...)
return wdContext.node<TableDataSource>.getLeadSelection() == IWDNode.NO_SELECTION
? WDVisibility.NONE : WDVisibilty.VISIBLE;
Bind the "visible" property of the group to this attribute.
Armin -
How to make VideoRecorderBrush scollable?
Hi. My root layout is a Grid and I'm using a Rectangle to display the AudioVideoCaptureDevice's viewfinder. I have a option to set the capture resolution to any resolution that is available by the API. When the capture resolution is
greater that the rectangle a lot of the information of the recording (video picture) is unseen. I know I can later see it by playing it back with a fill stretch. Can you teach me how to see it while recording i.a.w make some control scrollable like
the video recorder brush? Thanks in advance:-)I followed the "how to capture videos in Windows Phone" tutorial and it used VideoCaptureDevice API from Microsoft.Devices namespace. I edited the code and where able to capture videos using AudioVideoCaptureDevice (It took me a long time to get
it right). Here is the relevant code:
XAML:
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot"
Background="Transparent">
<!--Camera viewfinder >-->
<Rectangle x:Name="viewfinderRectangle" Width="auto" Height="auto" Stroke="White" Tap="ToggleZoom_Tap" StrokeThickness="5" HorizontalAlignment="Center" VerticalAlignment="Center">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="White" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<MediaElement x:Name="VideoPlayer" AutoPlay="True" Width="800" Height="480" RenderTransformOrigin="0.72,0.479" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="None"/>
Code behind:
// Viewfinder for capturing video.
private VideoBrush videoRecorderBrush;
private AudioVideoCaptureDevice vcDevice;
// File details for storing the recording.
private string isoVideoFileName = "iClips_Video";
private StorageFolder isoStore;
private StorageFile sfVideoFile;
//Reference for vibrate Control
VibrateController testVibrateController = VibrateController.Default;
// For managing button and application state.
private enum ButtonState
Initialized, Stopped, Ready, Recording, Playback, Paused, NoChange, CameraNotSupported
private ButtonState currentAppState;
public MainPage()
InitializeComponent();
//setup recording
// Prepare ApplicationBar and buttons.
PhoneAppBar = (ApplicationBar)ApplicationBar;
PhoneAppBar.IsVisible = true;
StartRecording = ((ApplicationBarIconButton)ApplicationBar.Buttons[0]);
StopPlaybackRecording = ((ApplicationBarIconButton)ApplicationBar.Buttons[1]);
StartPlayback = ((ApplicationBarIconButton)ApplicationBar.Buttons[2]);
PausePlayback = ((ApplicationBarIconButton)ApplicationBar.Buttons[3]);
//Life Cycle
protected async override void OnNavigatedTo(NavigationEventArgs e)
try
// Initialize the video recorder.
CameraSensorLocation location = CameraSensorLocation.Back;
captureResolutions =
AudioVideoCaptureDevice.GetAvailableCaptureResolutions(location);
await InitializeVideoRecorder(location, captureResolutions.FirstOrDefault());
RotateUI();
//prepare shutter hot keys
CameraButtons.ShutterKeyHalfPressed += OnButtonHalfPress;
CameraButtons.ShutterKeyPressed += OnButtonFullPress;
CameraButtons.ShutterKeyReleased += OnButtonRelease;
base.OnNavigatedTo(e);
catch (Exception ex)
MessageBox.Show("On Navigated To In Main Error:\n"+ex.Message.ToString());
protected override void OnNavigatedFrom(NavigationEventArgs e)
try
//enable screen locking
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled;
// Dispose of camera and media objects.
DisposeVideoPlayer();
DisposeVideoRecorder();
base.OnNavigatedFrom(e);
CameraButtons.ShutterKeyHalfPressed -= OnButtonHalfPress;
CameraButtons.ShutterKeyPressed -= OnButtonFullPress;
CameraButtons.ShutterKeyReleased -= OnButtonRelease;
catch (Exception ex)
MessageBox.Show("On Navigated From In Main Error:\n" + ex.Message.ToString());
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
RotateUI();
private void RotateUI()
try
this.Dispatcher.BeginInvoke(delegate()
if (vcDevice != null)
RotateTransform rt = new RotateTransform();
//Set a perfect orientation to capture with
if (this.Orientation == PageOrientation.LandscapeLeft)
txtDebug.Text = "LandscapeLeft";
if (vcDevice != null)
//rotate video camera
if (vcDevice.SensorLocation == CameraSensorLocation.Back)
vcDevice.SetProperty(KnownCameraGeneralProperties.EncodeWithOrientation, sensor_angle + 90);
else
vcDevice.SetProperty(KnownCameraGeneralProperties.EncodeWithOrientation, sensor_angle - 90);
if (videoRecorderBrush != null)
if (vcDevice.SensorLocation == CameraSensorLocation.Back)
videoRecorderBrush.RelativeTransform =
new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 90 };
else
videoRecorderBrush.RelativeTransform =
new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = -90 };
else
txtDebug.Text = "Video Recorder Brush not fully initialized.";
if (videoRecorderBrush != null)
videoRecorderBrush.RelativeTransform =
new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 90 };
//rotate logo
if (logo != null)
rt.Angle = 90;
logo.RenderTransformOrigin = new Point(0.5, 0.5);
logo.RenderTransform = rt;
//rotate record time ellapse
if (txtRecTime != null)
rt.Angle = 90;
txtRecTime.RenderTransformOrigin = new Point(0.2, 0.5);
txtRecTime.RenderTransform = rt;
//rotate sign in link
if (MyGrid != null)
rt.Angle = 90;
MyGrid.RenderTransformOrigin = new Point(0.5, 0.5);
MyGrid.RenderTransform = rt;
//rotate CanvasVideoInfo
rt.Angle = 90;
VideoInfoGrid.RenderTransformOrigin = new Point(0.5, 0.5);
VideoInfoGrid.RenderTransform = rt;
if (this.Orientation == PageOrientation.PortraitUp)
txtDebug.Text = "PortraitUp";
if (videoRecorderBrush != null)
videoRecorderBrush.RelativeTransform =
new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 90 };
//rotate logo
if (logo != null)
rt.Angle = 0;
logo.RenderTransformOrigin = new Point(0.5, 0.5);
logo.RenderTransform = rt;
//rotate record time ellapsed
if (txtRecTime != null)
rt.Angle = 0;
txtRecTime.RenderTransformOrigin = new Point(0.5, 0.5);
txtRecTime.RenderTransform = rt;
//rotate sign in link
if (MyGrid != null)
rt.Angle = 0;
MyGrid.RenderTransformOrigin = new Point(0.5, 0.5);
MyGrid.RenderTransform = rt;
//rotate CanvasVideoInfo
rt.Angle = 0;
VideoInfoGrid.RenderTransformOrigin = new Point(0.5, 0.5);
VideoInfoGrid.RenderTransform = rt;
if (this.Orientation == PageOrientation.LandscapeRight)
this.Dispatcher.BeginInvoke(delegate()
txtDebug.Text = "LandscapeRight";
// Rotate for LandscapeRight orientation.
if (videoRecorderBrush != null)
videoRecorderBrush.RelativeTransform =
new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 90 };
//rotate logo
if (logo != null)
rt.Angle = -90;
logo.RenderTransformOrigin = new Point(0.5, 0.5);
logo.RenderTransform = rt;
//rotate record time ellapsed
if (txtRecTime != null)
rt.Angle = -90;
txtRecTime.RenderTransformOrigin = new Point(0.2, 0.5);
txtRecTime.RenderTransform = rt;
//rotate MyGrid
if (MyGrid != null)
rt.Angle = -90;
MyGrid.RenderTransformOrigin = new Point(0.5, 0.5);
MyGrid.RenderTransform = rt;
//rotate CanvasVideoInfo
rt.Angle = -90;
VideoInfoGrid.RenderTransformOrigin = new Point(0.5, 0.5);
VideoInfoGrid.RenderTransform = rt;
catch (Exception ex)
MessageBox.Show("On Orientation Changed Error:\n" + ex.Message.ToString());
// Update the buttons and text on the UI thread based on app state.
private void UpdateUI(ButtonState currentButtonState, string statusMessage)
try
// Run code on the UI thread.
Dispatcher.BeginInvoke(delegate
switch (currentButtonState)
// When the camera is not supported by the phone.
case ButtonState.CameraNotSupported:
StartRecording.IsEnabled = false;
StopPlaybackRecording.IsEnabled = false;
StartPlayback.IsEnabled = false;
PausePlayback.IsEnabled = false;
break;
// First launch of the application, so no video is available.
case ButtonState.Initialized:
StartRecording.IsEnabled = true;
StopPlaybackRecording.IsEnabled = false;
StartPlayback.IsEnabled = false;
PausePlayback.IsEnabled = false;
break;
// Ready to record, so video is available for viewing.
case ButtonState.Ready:
StartRecording.IsEnabled = true;
StopPlaybackRecording.IsEnabled = false;
StartPlayback.IsEnabled = true;
PausePlayback.IsEnabled = false;
break;
// Video recording is in progress.
case ButtonState.Recording:
StartRecording.IsEnabled = false;
StopPlaybackRecording.IsEnabled = true;
StartPlayback.IsEnabled = false;
PausePlayback.IsEnabled = false;
break;
// Video Recording Stopped.
case ButtonState.Stopped:
StartRecording.IsEnabled = true;
StopPlaybackRecording.IsEnabled = false;
StartPlayback.IsEnabled = true;
PausePlayback.IsEnabled = false;
break;
// Video playback is in progress.
case ButtonState.Playback:
StartRecording.IsEnabled = false;
StopPlaybackRecording.IsEnabled = true;
StartPlayback.IsEnabled = false;
PausePlayback.IsEnabled = true;
break;
// Video playback has been paused.
case ButtonState.Paused:
StartRecording.IsEnabled = false;
StopPlaybackRecording.IsEnabled = true;
StartPlayback.IsEnabled = true;
PausePlayback.IsEnabled = false;
break;
default:
break;
// Display a message.
txtDebug.Text = statusMessage;
// Note the current application state.
currentAppState = currentButtonState;
catch (Exception ex)
MessageBox.Show("UpdateUI Error:\n" + ex.Message.ToString());
private async Task InitializeVideoRecorder(CameraSensorLocation sensorLocation, Windows.Foundation.Size sz)
try
string[] dimensions = sz.ToString().Split(',');
//open video camera device in this resolution
vcDevice = await AudioVideoCaptureDevice.OpenAsync(sensorLocation, sz);
vcDevice.RecordingFailed += OnCaptureFailed;
vcDevice.VideoEncodingFormat = CameraCaptureVideoFormat.H264;
vcDevice.AudioEncodingFormat = CameraCaptureAudioFormat.Aac;
// Initialize the camera if it exists on the phone.
if (vcDevice != null)
//initialize fileSink
await InitializeFileSink();
// Create the VideoBrush for the viewfinder.
videoRecorderBrush = new VideoBrush();
videoRecorderBrush.SetSource(vcDevice);
this.Dispatcher.BeginInvoke(delegate()
// Display the viewfinder image on the rectangle.
viewfinderRectangle.Fill = videoRecorderBrush;
//set the resolution
viewfinderRectangle.Width = Convert.ToDouble(dimensions[1]);
viewfinderRectangle.Height = Convert.ToDouble(dimensions[0]);
VideoPlayer.Width = Convert.ToDouble(dimensions[1]);
VideoPlayer.Height = Convert.ToDouble(dimensions[0]);
resMI.Content = Convert.ToString(dimensions[0]) + "*" + Convert.ToString(dimensions[1]);
resMI_Shadow.Content = Convert.ToString(dimensions[0]) + "*" + Convert.ToString(dimensions[1]);
// Set the button state and the message.
UpdateUI(ButtonState.Initialized, "Tap record to start recording...");
else
// Disable buttons when the camera is not supported by the phone.
UpdateUI(ButtonState.CameraNotSupported, "A camera is not supported on this phone.");
/*Create Picture Perfect
//orient preview picture size from the computed anle.
var tmp = new CompositeTransform() { Rotation = ComputeAngle(this.Orientation) };
var previewSizeW = tmp.TransformBounds(new Rect(new Point(), new Size(vcDevice.PreviewResolution.Width, vcDevice.PreviewResolution.Height))).Width;
var previewSizeH = tmp.TransformBounds(new Rect(new Point(), new Size(vcDevice.PreviewResolution.Width, vcDevice.PreviewResolution.Height))).Height;
var previewSize = tmp.TransformBounds (new Rect(new Point(), new Size(m_captureDevice.PreviewResolution.Width, vcDevice.PreviewResolution.Height))).Size;
double s1 = viewfinderRectangle.Width / (double)previewSizeW;
double s2 = viewfinderRectangle.Height / (double)previewSizeH;
if (sensorLocation == CameraSensorLocation.Back)
videoRecorderBrush.Transform = new CompositeTransform()
Rotation = ComputeAngle(this.Orientation),
CenterX = viewfinderRectangle.Width / 2,
CenterY = viewfinderRectangle.Height / 2,
ScaleX = s1,
ScaleY = s2
else
videoRecorderBrush.Transform = new CompositeTransform()
Rotation = ComputeAngle(this.Orientation),
CenterX = viewfinderRectangle.Width / 2,
CenterY = viewfinderRectangle.Height / 2,
ScaleX = s1,
ScaleY = -1 * s2
};//Y mirror
catch (Exception ex)
MessageBox.Show("InitializeVideoRecorder Error:\n" + ex.Message);
double ComputeAngle(PageOrientation orientation)
if ((orientation & PageOrientation.Portrait) == PageOrientation.Portrait)
return vcDevice.SensorRotationInDegrees;
else if ((orientation & PageOrientation.LandscapeLeft) == PageOrientation.LandscapeLeft)
return vcDevice.SensorRotationInDegrees - 90;
else //PageOrientation.LandscapeRight
return vcDevice.SensorRotationInDegrees + 90;
//setup iClips video file creation
private async Task InitializeFileSink()
try
isoStore = await ApplicationData.Current.LocalFolder.GetFolderAsync("Shared");
sfVideoFile = await isoStore.CreateFileAsync(isoVideoFileName + ".mp4",
CreationCollisionOption.ReplaceExisting);
s = await sfVideoFile.OpenAsync(FileAccessMode.ReadWrite);
catch (Exception ex)
MessageBox.Show("Initialize File Sink Error:\n" + ex.Message.ToString());
// Set the recording state: display the video on the viewfinder.
private void StartVideoPreview()
try
// Display the video on the viewfinder.
if (vcDevice != null)
if (videoRecorderBrush == null)
// Create the VideoBrush for the viewfinder.
videoRecorderBrush = new VideoBrush();
videoRecorderBrush.SetSource(vcDevice);
// Display the viewfinder image on the rectangle.
viewfinderRectangle.Fill = videoRecorderBrush;
// Set the button states and the message.
UpdateUI(ButtonState.Ready, "Ready to record.");
txtRecTime.Visibility = Visibility.Collapsed;
// If preview fails, display an error.
catch (Exception e)
MessageBox.Show("Start Video Preview Exception:\n " + e.Message.ToString());
// Set recording state: start recording.
private async void StartVideoRecording()
try
//disable screen locking
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
if (vcDevice != null)
VideoInfoGrid.Visibility = Visibility.Collapsed;
if (s == null)
s = await sfVideoFile.OpenAsync(FileAccessMode.ReadWrite);
await vcDevice.StartRecordingToStreamAsync(s);
rState = 1;
logo.Opacity = 1.0; //brighten logo to indicate that the recording started
signForm_Shadow.Opacity = 1.0;
resMI_Shadow.Opacity = 1.0;
cOrientation.Opacity = 1.0;
ToggleCameraShadow.Opacity = 1.0;
StartTimer(); //show time ellapsed on UI
// Set the button states and the message.
UpdateUI(ButtonState.Recording, "Recording...");
// If recording fails, display an error.
catch (Exception e)
MessageBox.Show("Start Video Recording Error:\n" + e.Message.ToString());
// Set the recording state: stop recording.
private async void StopVideoRecording()
try
//enable screen locking
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled;
await vcDevice.StopRecordingAsync();
rState = 0;
logo.Opacity = 0.1;
signForm_Shadow.Opacity = 0.5;
resMI_Shadow.Opacity = 0.5;
ToggleCameraShadow.Opacity = 0.5;
cOrientation.Opacity = 0.5;
StopTimer();
txtRecTime.Visibility = Visibility.Collapsed;
// Set the button states and the message.
UpdateUI(ButtonState.Stopped, "Recording stopped.");
DisplayVideoInformation();
// If stop fails, display an error.
catch (Exception e)
MessageBox.Show("Stop Video Recording:\n " + e.Message.ToString());
private void DisplayVideoInformation()
try
VideoInfoGrid.Visibility = Visibility.Visible;
txtVideoDate.Text = "Date: " + System.DateTime.Now;
txtVideoDuration.Text = "Duration: " + txtRecTime.Text;
txtVideoName.Text = "Name: " + sfVideoFile.Name;
txtVideoSize.Text = "Size: ";
txtVideoType.Text = "Type: " + "MP4";
catch (Exception ex)
MessageBox.Show("Display Video Information Error:\n" + ex.Message.ToString());
// Start the video recording.
private void StartRecording_Click(object sender, EventArgs e)
// Avoid duplicate taps.
StartRecording.IsEnabled = false;
StartVideoRecording();
private void DisposeVideoRecorder()
try
//enable screen locking
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled;
if (vcDevice != null)
// Remove the event handler for captureSource.
vcDevice.RecordingFailed -= OnCaptureFailed;
if (s != null)
s.Dispose();
if (sfVideoFile != null)
sfVideoFile = null;
if (videoRecorderBrush != null)
videoRecorderBrush = null;
// Remove the video recording objects.
vcDevice.Dispose();
//vcDevice = null;
catch (Exception ex)
MessageBox.Show("Dispose Video Recorder Error:\n" + ex.Message.ToString());
private void OnCaptureFailed(AudioVideoCaptureDevice sender, CaptureFailedEventArgs args)
try
//enable screen locking
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled;
MessageBox.Show("Recording Failed!");
rState = 0;
logo.Opacity = 0.1;
signForm_Shadow.Opacity = 0.5;
resMI_Shadow.Opacity = 0.5;
ToggleCameraShadow.Opacity = 0.5;
cOrientation.Opacity = 0.5;
catch (Exception ex)
MessageBox.Show("On Capture Failed Error:\n " + ex.Message.ToString());
I added some other methods that are related to the Video Capturing but you can just look in InitializeVideoRecorder to see how I'm binding the AudioVideoCaptureDevice preview to the rectangle...Tell me if you need more info and thanks so long -
WPF: How to make Tab Header to show three different icons?
Our WPF application needs Tab header to show three different icons and Foreground.
If tab is not selected, show one icon and black foreground. If tab is selected, show another icon and white foreground. If tab is selected and also require show Chromestyle, show third icon and red foreground.
we have tried the following code. However, MultiDataTrigger section does not work.
<TabItem x:Name="tabItemSetup" Header="Setup">
<TabItem.HeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<Image x:Name="imgSetup" Height="50" Width="65" Source="Resources/Images/UNSELECTED_Setup Icon.png" DockPanel.Dock="Top" />
<TextBlock x:Name="txtSetup" Text="{Binding}" Foreground="Black" Style="{StaticResource TabTextStyle}" DockPanel.Dock="Bottom" FontFamily="Eras ITC" FontSize="13.333"/>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type TabItem}}}" Value="True">
<Setter TargetName="txtSetup" Property="Foreground" Value="White"/>
<Setter TargetName="imgSetup" Property="Source" Value="Resources/Images/SELECTED_Setup Icon.png"/>
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsChromeStyle}" Value="True"/>
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type TabItem}}}" Value="True"/>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter TargetName="txtSetup" Property="Foreground" Value="Red"/>
<Setter TargetName="imgSetup" Property="Source" Value="Resources/Images/Chrome SELECTED_Setup Icon.png"/>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</TabItem.HeaderTemplate>
</TabItem>
Does anyone know how to make it work? Thx!
JaneCWhere is the IsChromeStyle property defined? It is the Header, i.e. the string "Setup" that is the DataContext of the HeaderTemplate and the a string has no property called IsChromeStyle so you must specify a source for the binding.
If for example the DataContext object of the TabControl, or the parent of the TabControl (for example the window or whatever) has a property called IsChromeStyle you could bind to this one using a RelativeSource:
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding DataContext.IsChromeStyle, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="True"/>
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type TabItem}}}" Value="True"/>
</MultiDataTrigger.Conditions>
Then it should work. It is the binding that fails.
Please remember to close your threads by marking helpful posts as answer. -
I have a problem
I wanna make global variable (not bind variable), and every page in portal can use this variable.
Can anybody tell me how to make this var ?
TIAI have used session variables to do what you are trying to do.
Checkout http://technet.oracle.com/products/iportal/files/pdkjan/articles/primer.session.storage.html for a primer on session storage, and especially http://technet.oracle.com/products/iportal/files/pdkjan/plsql/doc/sdk20pkg.htm for how to use wwsto_api_session.
Ken Atkins
Computer Resource Team (www.crtinc.com)
Maybe you are looking for
-
I have a new iPhone 4s - having lots of trouble with Siri. It seems cranky - sometimes works, somtimes not. My other issue - is there a way to create a mail signature using the font I use in Outlook (or can I import that signature)? How can I find
-
Sierra 881U aircard no WWAN icon in menu bar
I am running a Sierra 881U aircard with AT&T 3G service and it is fast--works fine; BUT--there is no WWAN icon in my menu bar like there should be. I have installed the Sierrra's "Install Switch Driver" to enable native support but I have to open net
-
Hallelujha - this site opens links in a new Window
At last. Its never done this for me before!
-
How to create a new paper size preset in photoshop CS6
Hi, Im trying to create a new paper size preset in PS CS6. I was told if I went to my PS folder, I will find a folder named presets. Inside that folder there should be a text document called "New Doc Sizes.txt" but it's not there. Has anyone any idea
-
Hey All, Is there a way to force Acrobat to open a copy of a form when the user opens it up? I am asking because I have some signature fields on a form and I don't want the user to open up the original and place a signature and then we have to send